设置npm淘宝源:(全局)
如果想设置自己的内网私有的NPM 请更改地址为自己公司的内部地址即可:
npm config set registry http://registry.npm.taobao.org/
查看是否设置成功:
npm config get registry //也就是查看当前的 NPM 源 地址是什么
如下图:
Snipaste_2019-07-02_13-32-38.png
单次使用 (这里以 使用 "淘宝源" 安装 "饿了么Ui" 为例)
npm --registry=https://registry.npm.taobao.org install element-ui
npm常用命令
#安装包
npm install <pkg> 或者 npm install <pkg>@<version>
#卸载包
npm uninstall <name> 或者 npm uninstall <name>@[<version>]