目录一、使用npm查看当前源、切换淘宝镜像、切换官方源二、使用nrm查看和切换镜像补充:npm常用命令总结一、使用npm查看当前源、切换淘宝镜像、切换官方源 (1)npm查看当前源:
(1)npm查看当前源:
npm get reGIStry
(2)npm设置淘宝镜像源:
npm config set registry Http://registry.npm.taobao.org
(3)npm设置官方源:
npm config set registry http://www.npmjs.org
1、首先通过npm安装nrm:
npm install -g nrm
2、通过nrm查看和切换镜像源(命令):nrm ls
注意:下面的 * 表示当当前正在使用的源,
* npm -------- https://registry.npmjs.org/
yarn ------- https://registry.yarnpkg.com/
cnpm ------- http://r.cnpmjs.org/
taobao ----- https://registry.npm.taobao.org/
nj --------- https://registry.nodejitsu.com/
npmMirror -- https://skimdb.npmjs.com/registry/
edunpm ----- http://registry.enpmjs.org/
3、如果想要使用某一个,直接use,比如我要使用淘宝镜像的源:
nrm use taobao
出现下面提示就说明切换成功了!
4、如果出现下面的爆红情况:可能是没有全局安装nrm,npm install -g nrm。全局安装记得加-g
如有问题,欢迎指正!!!
npm -v
//查看点前npm版本
npm -help
//查看命令
npm config get registry
//查看当前下载源
npm config set registry https://registry.npm.taobao.org/
npm config set registry https://registry.npmjs.org/
//设置下载源
http://Maven.linkintrust.com:9999/repository/ltms-front-public/
npm install mockjs --save-dev --registry=https://registry.npm.taobao.org --verbose
到此这篇关于npm与nrm两种方式查看源和切换镜像的文章就介绍到这了,更多相关npm nrm查看源和切换镜像内容请搜索编程网以前的文章或继续浏览下面的相关文章希望大家以后多多支持编程网!
--结束END--
本文标题: npm与nrm两种方式查看源和切换镜像详解
本文链接: https://www.lsjlt.com/news/195479.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-01-12
2023-05-20
2023-05-20
2023-05-20
2023-05-20
2023-05-20
2023-05-20
2023-05-20
2023-05-20
2023-05-20
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0