dylang / npm-check

Check for outdated, incorrect, and unused dependencies.
https://www.npmjs.com/package/npm-check
MIT License
6.56k stars 239 forks source link

Broken in asdf nodejs version manager when updating global package #333

Open td0 opened 5 years ago

td0 commented 5 years ago

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.

coreygo commented 1 year ago

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 ```sh $ 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… 🖖