dylang / npm-check

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

npm-check -g doesn't work on Windows Scoop #344

Open donniean opened 5 years ago

donniean commented 5 years ago

node v12.4.0 (installed by Scoop)

npm v6.9.0


My Node.js installed by Scoop

scoop install nodejs

npm-check -g

out put

Path "C:\Users\Administrator\AppData\Roaming\npm\node_modules" does not exist. Please check the NODE_PATH environment variable.
issam-seghir commented 1 year ago

I installed Node with Scoop and encountered a similar issue. Here's how I resolved it:

  1. Set NODE_PATH Variable: Confirm the npm Global Prefix. This determines where global npm modules are installed. Check the prefix by running:

    npm config get prefix
    # In my case: E:\Apps\scoop\persist\nvm\nodejs\nodejs
  2. Right-click "This PC" > Properties > Advanced system settings > Environment Variables. In the "User variables" section, verify if NODE_PATH exists. If not, create a new variable named NODE_PATH with the value as the path to your global npm modules directory (e.g., E:\Apps\scoop\persist\nvm\nodejs\nodejs).

  3. Restart your PowerShell or terminal by closing and reopening it.

  4. Type npm-check -g in your terminal, and you should see something like this :

image