npm相关操作

189 阅读1分钟

操作环境: windows10 ,NodeJS v8.3.0,NPM v5.3.0

1.查看基本配置

npm config list

图片.png

2.查看完整配置

npm config ls -l

图片.png

3.代理

代理地址以自己为主

配置:npm config set proxy=http://127.0.0.1:1080
删除:npm config delete proxy

4.镜像地址registry

配置:npm config set registry= http://registry.cnpmjs.org
删除:npm config delete registry

5.node-sass、electron 和 phantomjs安装缓慢

github.com/lmk123/blog…

6.安装sha错误

  • 删除node_modules
  • npm cache clean --force
  • npm cache verify 查看是否清理

7.使用nrm管理镜像地址

npm install -g nrm