npm 淘宝设置代理

时间:2023-03-10 04:54:08
npm 淘宝设置代理

直接安装cnpm导致无限索引,因此直接使用代理

  

方法一:

直接在当前用户文件夹下,npmrc 文件上直接设置代理:registry=https://registry.npm.taobao.org

方法二:

安装时临时指定代理:

npm install data_js --registry=https://registry.npm.taobao.org

全局配置:

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

npm config list ## 查看刚才的配置是否生效