nodejs npm global config missing on windows

后端 未结 7 791
囚心锁ツ
囚心锁ツ 2020-12-12 19:27

I can\'t find at all where npm has its global settings stored.

npm config get userconfig

C:\\Users\\Jack\\.npmrc

npm config get glo

7条回答
  •  再見小時候
    2020-12-12 19:41

    How to figure it out

    Start with npm root -- it will show you the root folder for NPM packages for the current user. Add -g and you get a global folder. Don't forget to substract node_modules.

    Use npm config / npm config -g and check that it'd create you a new .npmrc / npmrc file for you.

    Tested on Windows 10 Pro, NPM v.6.4.1:

    Global NPM config

    C:\Users\%username%\AppData\Roaming\npm\etc\npmrc
    

    Per-user NPM config

    C:\Users\%username%\.npmrc
    

    Built-in NPM config

    C:\Program Files\nodejs\node_modules\npm\npmrc
    

    References:

    • https://docs.npmjs.com/files/npmrc
    • https://docs.npmjs.com/misc/config
    • https://docs.npmjs.com/cli/root.html

提交回复
热议问题