NPM 国内慢的问题解决

3,667 阅读1分钟

方法一:

更改npm配置文件:

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

URL 即为需要设置的镜像站点地址,如淘宝镜像: http://registry.npm.taobao.org


方法二:

你可以使用淘宝 NPM 镜像定制的 cnpm (gzip 压缩支持) 命令行工具代替默认的 npm:

$ npm install -g cnpm --registry=https://registry.npm.taobao.org

这样就可以使用 cnpm 命令来安装模块了:

$ cnpm install [name]

实例

安装 Express 开发框架:

$ cnpm install express

其他镜像


END--