NPM镜像管理

npm管理

查看npm源地址

npm config list

修改registry地址,比如修改为淘宝镜像源

npm set registry https://registry.npm.taobao.org/

删除registry地址

npm config rm registry

nrm管理

安装

npm install nrm -g --save

查看npm源地址

nrm ls

查看当前使用的是哪个源

nrm current

切换源

nrm use cnpm

添加公司私有npm源

nrm add qihoo http://registry.npm.360.org

测试速度

nrm test npm

删除源

nrm del qihoo

更新Node版本和npm版本

# 非必须
sudo npm cache clean -f

# 安装"n"版本管理工具,管理node(没有错,就是n)
sudo npm install -g n

# 更新node版本
sudo npm install npm@latest -g

# 查看本机当前Node和npm的版本
node -v
npm -v
posted @ 2020-11-16 10:34  Feng1024  阅读(146)  评论(0编辑  收藏  举报