npm镜像使用方法

来源:互联网 发布:matlab高级编程 pdf 编辑:程序博客网 时间:2024/05/01 11:55

npm镜像,就是npm的只读副本。

使用方法有3种,推荐第一种或者第三种

编辑 ~/.npmrc 加入下面内容

registry = http://registry.cnpmjs.org
永久生效。

config命令

npm config set registry http://registry.cnpmjs.org
npm info underscore (如果上面配置正确这个命令会有字符串response)
永久生效。

命令行指定

npm –registry http://registry.cnpmjs.org info underscore
本次有效。

国内镜像资源

http://r.cnpmjs.org/
http://registry.cnpmjs.org/
http://registry.npm.taobao.org
搜索镜像:

http://cnpmjs.org
http://npm.taobao.org/

0 0
原创粉丝点击