npm镜像切换三法

作者: 小枫学幽默 | 来源:发表于2019-07-20 12:50 被阅读7次

方法一

临时切换下

npm --registry https://registry.npm.taobao.org install vue

方法二

切换后保持此镜像(设置永久镜像地址为淘宝的镜像)

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

方法三

nrm切换源

  • 1、安装nrm
npm install -g nrm
  • 2、使用

列出所有可用的源

nrm ls                                                                                                              

输出结果

* npm ---- https://registry.npmjs.org/
  cnpm --- http://r.cnpmjs.org/
  taobao - http://registry.npm.taobao.org/
  eu ----- http://registry.npmjs.eu/
  au ----- http://registry.npmjs.org.au/
  sl ----- http://npm.strongloop.com/
  nj ----- https://registry.nodejitsu.com/

带 * 的是当前使用的源

切换源

切换到taobao

nrm use taobao

增加源(适合公司内部搭建有私有源的)

nrm add [源名称] [源地址]

删除源

nrm del taobao

总结 推荐使用nrm,切换很方便有木有?!

附上

原本镜像地址
https://registry.npmjs.org/

淘宝镜像地址

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

相关文章

  • npm镜像切换三法

    方法一 临时切换下 方法二 切换后保持此镜像(设置永久镜像地址为淘宝的镜像) 方法三 nrm切换源 1、安装nrm...

  • 常见npm指令(持续更新)

    切换淘宝镜像 查看当前镜像地址: ·npm get registry 切换为淘宝镜像: npm config se...

  • 常用的git命令

    安装依赖 npm install 查看镜像 npm get registry 切换淘宝镜像 npm config ...

  • npm安装yarn并切换淘宝镜像

    npm切换淘宝镜像 安装yarn yarn切换淘宝镜像 yarn sass 切换淘宝镜像

  • 搭建小程序开发环境

    npm慢的话,可安装nrm切换镜像源。nrm是npm的镜像源管理工具,可在 npm 源间切换npm install...

  • npm,yarn包管理器

    镜像切换npm npm config set registry https://registry.npm.taob...

  • npm镜像切换

    npm install -g nrm nrm ls 查看镜像列表 nrm use cnpm 使用具体的镜像

  • npm切换镜像

    方法一:直接编辑npm的配置文件npm config edit修改registry的地址registry=http...

  • npm 镜像切换

    npm镜像 通过config命令 国内源: 原始源: 配置后可通过下面方式验证是否成功:

  • npm切换镜像

    切换淘宝镜像 切换默认镜像 其他镜像地址查询 安装nrm 其他镜像地址查询

网友评论

    本文标题:npm镜像切换三法

    本文链接:https://www.haomeiwen.com/subject/tgnylctx.html