npm 更改为淘宝镜像的方法
2018-04-19 15:08
561 查看
1、命令行临时使用指定镜像(淘宝)
npm --registry https://registry.npm.taobao.org install express
2、命令行永久更改使用指定镜像(淘宝)
npm config set registry https://registry.npm.taobao.org
以后 npm install express 默认使用指定(淘宝)镜像
3、通过npm配置文件直接修改,本质和第2条一样,配置文件位置(windows环境)为C盘下的.npmrc文件(百度很容易查到文件路径),MAC没试过。
4、使用淘宝 NPM 镜像(参考 http://www.runoob.com/nodejs/nodejs-npm.html)
命令行输入
$ npm install -g cnpm --registry=https://registry.npm.taobao.org
这样就可以使用 cnpm 命令来安装模块了: cnpm installexpress
查看目前使用的npm镜像的方法:
npm config get registry
相关文章推荐
- npm 更改为淘宝镜像的方法
- npm太慢, 淘宝npm镜像使用方法
- npm用法以及更换到淘宝镜像的方法
- npm太慢, 淘宝npm镜像使用方法
- npm太慢, 淘宝npm镜像使用方法
- npm 更改默认全局路径以及国内镜像的方法
- npm太慢, 淘宝npm镜像使用方法
- 淘宝NPM镜像使用方法
- npm太慢, 淘宝npm镜像使用方法
- 淘宝npm镜像使用方法
- 淘宝npm镜像使用方法(转)
- npm太慢, 淘宝npm镜像使用方法
- npm太慢, 淘宝npm镜像使用方法
- npm太慢, 淘宝npm镜像使用方法
- npm太慢, 淘宝npm镜像使用方法
- 淘宝npm镜像使用方法
- 为npm设置淘宝镜像的方法
- npm下载包超时,切换成淘宝镜像下载方法
- npm用法以及更换到淘宝镜像的方法
- npm太慢, 淘宝npm镜像使用方法