node-gh / gh

(DEPRECATED) GitHub CLI made with NodeJS. Use the official https://cli.github.com/ instead.
http://nodegh.io
Other
1.71k stars 217 forks source link

warning: Can't read plugins directory. #536

Closed ahmadawais closed 6 years ago

ahmadawais commented 6 years ago

The cli is working fine but I keep getting this warning at the top and end of the process.

warning: Can't read plugins directory.

image

$ npm -v && node -v
6.0.0
v9.7.1
ahmadawais commented 6 years ago

Fixed it by ~/.gh.json file.

rotty3000 commented 5 years ago

I see this message but I have a ~/.gh.json file. Any ideas?

rotty3000 commented 5 years ago

Ok, On Ubuntu 18.10 the node module install directory is now /usr/local/lib/node_modules.

Editing the ~/.gh.json file and changing the line: "plugins_path": "/usr/lib/node_modules" to "plugins_path": "/usr/local/lib/node_modules" fixed the issue.

protoEvangelion commented 5 years ago

@rotty3000 When gh is run, we look for plugins_path and if it is not in your ~/.gh.json we run npm root -g which outputs the dir of your global node_modules path. Then we add that path to ~/.gh.json.

I'm not sure why that isn't working in your case.

For future proofing npm installations I like doing this: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally#manually-change-npms-default-directory

rotty3000 commented 5 years ago

@protoEvangelion I think the issue was that my .gh.json had an actual value, but it was incorrect.

protoEvangelion commented 5 years ago

Got it, thanks for the clarification 😄