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

First time user is unable to run any command #739

Closed marcbizal closed 4 years ago

marcbizal commented 4 years ago

Version number 2.7.0

Describe the bug I am unable to use gh due to an error that occurs when running any command.

{ Error: ENOENT: no such file or directory, open '/Users/marcusbizal/.nvm/versions/node/v12.8.1/lib/node_modules/gh/default.gh.json'
    at Object.openSync (fs.js:448:3)
    at Object.readFileSync (fs.js:348:35)
    at Object.createGlobalConfig (/Users/marcusbizal/.nvm/versions/node/v12.8.1/lib/node_modules/gh/lib/configs.js:113:53)
    at Object.run (/Users/marcusbizal/.nvm/versions/node/v12.8.1/lib/node_modules/gh/lib/cmd.js:159:19)
    at Object.<anonymous> (/Users/marcusbizal/.nvm/versions/node/v12.8.1/lib/node_modules/gh/bin/gh.js:24:26)
    at Module._compile (internal/modules/cjs/loader.js:805:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:816:10)
    at Module.load (internal/modules/cjs/loader.js:672:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:612:12)
    at Function.Module._load (internal/modules/cjs/loader.js:604:3)
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path:
   '/Users/marcusbizal/.nvm/versions/node/v12.8.1/lib/node_modules/gh/default.gh.json' }

To Reproduce Steps to reproduce the behavior:

  1. npm i -g gh
  2. gh

Expected behavior I should be able to use gh commands.

Additional context I have not previously used gh on this machine, I have no existing configuration files. Looks like gh is trying to createGlobalConfig by saving the default config (in the package) to my home directory. However default.gh.json is not included in the files portion of the package.json, as such it is not available when installed via npm.

protoEvangelion commented 4 years ago

@marcbizal thanks for the bug report. I will take a look ASAP!

protoEvangelion commented 4 years ago

:tada: This issue has been resolved in version 2.7.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

protoEvangelion commented 4 years ago

Thanks for the clear report @marcbizal that fixed it!

protoEvangelion commented 4 years ago

@all-contributors please add @marcbizal for awesome bug report

allcontributors[bot] commented 4 years ago

@protoEvangelion

I've put up a pull request to add @marcbizal! :tada: