Closed rotty3000 closed 5 years ago
Hmm something seems off. I just tested it locally and all it does is run this function which reads the globally installed package.json:
Version.prototype.printVersion = function(pkg) {
logger.log(`${pkg.name} ${pkg.version}`)
}
My globally installed package.json has the correct version. If you try this cat $(npm root -g)/gh/package.json | grep version
what does it show?
~]$ cat $(npm root -g)/gh/package.json | grep version
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
"version": "1.17.3"
I also deleted all the directories in $HOME
that may have had some effect on the version, .node
, .npm
, .yarn
, and anything else that seemed somehow related to node.js/npm/yarn.
... same problem.
What is the output of: which gh
and npm root -g
?
]$ which gh
/usr/local/bin/gh
]$ npm root -g
/usr/lib/node_modules
with that I discovered I have:
/usr/local/lib/node_modules/gh
and /usr/lib/node_modules/gh
I think I should be able to figure out from here where the two come from by asking apt who provides those directories. I'll put the info here for posterity once I figure that out.
Hmm I resolved a similar issue by manually setting where npm installs global dependencies with these instructions: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally#manually-change-npms-default-directory
That might resolve your issue as well :)
so I couldn't find the package that provided the /usr/local/
stuff, so I just removed gh
from there, and now I get the right version. Thx for you help!
How to solve the following scenario: