npm-check icon indicating copy to clipboard operation
npm-check copied to clipboard

Broken in asdf nodejs version manager when updating global package

Open td0 opened this issue 6 years ago • 1 comments

when checking for global package npm-check -g, it keeps saying that there're updates available, even after you update the said 'old version' global package.

I've tried adding environment variable such as NODE_PATH=.asdf/installs/nodejs/10.15.2/.npm/lib/node_modules/ npm-check -gu, but still didn't work.

td0 avatar Mar 05 '19 16:03 td0

This is likely related to asdf-vm/asdf-nodejs#228.

I tested that fix manually: rm -rf ~/.asdf/plugins/nodejs/bin/{exec-env,list-bin-paths}

Removed the existing nodejs installs: rm -rf ~/.asdf/installs/nodejs

Then asdf install nodejs lts to reinstall nodejs and all global packages, npm-check -g works as expected.

npm-check truncated debug output
$ npm-check -g --debug
[npm-check] debug
cli.flags {
  global: true,
  debug: true,
  update: false,
  updateAll: false,
  skipUnused: false,
  production: false,
  devOnly: false,
  saveExact: false,
  color: false,
  emoji: true,
  spinner: true
}
===============================
[npm-check] debug
cli.input []
===============================
[npm-check] debug
set key spinner to value true
===============================
[npm-check] debug
set key ignore to value undefined
===============================
The global path you are searching is: /Users/corey/.asdf/installs/nodejs/16.16.0/lib/node_modules // ✅
[npm-check] debug
set key cwd to value /Users/corey/.asdf/installs/nodejs/16.16.0/lib/node_modules // ✅

Hope that helps… 🖖

coreygo avatar Aug 14 '22 21:08 coreygo