node-gh / gh

(DEPRECATED) GitHub CLI made with NodeJS. Use the official https://cli.github.com/ instead.

Home Page:http://nodegh.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

First time user is unable to run any command

marcbizal opened this issue Β· comments

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.

commented

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

commented

πŸŽ‰ This issue has been resolved in version 2.7.1 πŸŽ‰

The release is available on:

Your semantic-release bot πŸ“¦πŸš€

commented

Thanks for the clear report @marcbizal that fixed it!

commented

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