maxlath / wikibase-cli

read and edit a Wikibase instance from the command line
MIT License
227 stars 24 forks source link

Runtime error #17

Closed bzg closed 7 years ago

bzg commented 7 years ago

After installing with sudo npm install -g wikidata-cli I get this error when running wd config or other commands presented in the README.md - any idea what I'm doing wrong? node -v (through nvm) is 6.8.1

fs.js:248
  binding.access(pathModule._makeLong(path), mode);
          ^

Error: ENOENT: no such file or directory, access '/home/guerry/.config/wikidata-cli'
    at Error (native)
    at Object.fs.accessSync (fs.js:248:11)
    at Object.writeAccessSync (/usr/local/lib/node_modules/wikidata-cli/lib/fs.js:26:8)
    at module.exports (/usr/local/lib/node_modules/wikidata-cli/lib/get_folder_path.js:18:8)
    at Object.<anonymous> (/usr/local/lib/node_modules/wikidata-cli/lib/config/file_path.js:2:51)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
maxlath commented 7 years ago

thanks for reporting! It seems lib/get_folder_path.js is to blame: it tries to get access rights on a folder that wasn't previously created. I'm working on a patch. Meanwhile, it should be solved by running mkdir ~/.config/wikidata-cli

bzg commented 7 years ago

Thanks for the quick reply, I confirm the quick fix!

maxlath commented 7 years ago

@bzg v4.5.1 ships with the patch, you can get it by running sudo npm install -g wikidata-cli@latest. You don't really need it though, now that you created the folder.

bzg commented 7 years ago

Thanks!