原始源
安装完node之后,默认的原始源是:
1 | https://registry.npmjs.org/ |
使用淘宝镜像
临时使用
1 | npm --registry https://registry.npm.taobao.org install express |
持久使用
1 | npm config set registry https://registry.npm.taobao.org |
通过cnpm
1 | npm install -g cnpm --registry=https://registry.npm.taobao.org |
使用官方镜像
1 | npm config set registry https://registry.npmjs.org/ |
查看npm源地址
1 | npm config get registry |