NPM命令大全
查看当前的npm镜像设置
1 | npm config list |
cnpm的卸载和重新安装
- 卸载旧版本
1
npm uninstall -g cnpm --registry=https://registry.npmmirror.com
- 配置镜像源(淘宝镜像)
1
npm config set registry https://registry.npmmirror.com
- 确保node-gyp编译依赖的node源码镜像同步
1
npm config set disturl https://registry.npmmirror.com/dist
- 清除缓存
1
npm cache clean --force
- 安装新的cnpm版本
1
npm install -g cnpm --registry=https://registry.npmmirror.com
npm升级
- 升级到指定版本
1
npm install npm@6.14.17
- 升级到最新版本
1
npm install npm@latest -g