使用淘宝的cnpm代替npm
直接安装cnpm 安装淘宝提供的cnpm,并更改服务器地址为淘宝的国内地址, 命令:
npm install -g cnpm --registry=https://registry.npm.taobao.org
,以后安装直接采用cpm替代npm, 例如原生
npm命令为:
npm install uniq --save
cnpm命令为:
cnpm install uniq --save
第二种:
替换npm仓库地址为淘宝镜像地址(推荐)
命令:
npm config set registry https://registry.npm.taobao.org
查看是否更改成功:
npm config get registry