npm使用淘宝源
1
| npm config set registry https://registry.npmmirror.com/
|
.npmrc
1 2 3
| registry=https://registry.npmmirror.com/ sass_binary_site=https://npm.taobao.org/mirrors/node-sass/ electron_mirror=https://npm.taobao.org/mirrors/electron/
|
使用cnpm
1
| npm install -g cnpm@6.2.0 --registry=https://registry.npmmirror.com
|
.yarnrc
1 2 3 4 5 6 7 8
|
registry "https://registry.npmmirror.com/" electron_mirror "https://npm.taobao.org/mirrors/electron/" lastUpdateCheck 1692882092809 sass_binary_site "https://npm.taobao.org/mirrors/node-sass/"
|
使用nvm管理node版本
1 2 3 4 5
| nvm ls
nvm use 16.20.1
|
Fixing npm permissions
1
| sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
|
This changes the permissions of the sub-folders used by npm and some other tools (lib/node_modules, bin, and share).