当前位置:网站首页>How to change npm to Taobao mirror [easy to understand]
How to change npm to Taobao mirror [easy to understand]
2022-07-31 18:23:00 【Full stack programmer webmaster】
大家好,又见面了,我是你们的朋友全栈君.
npm The method of changing to Taobao mirror
1、命令行临时使用指定镜像(淘宝)
npm --registry https://registry.npm.taobao.org install express
2、命令行永久更改使用指定镜像(淘宝)
npm config set registry https://registry.npm.taobao.org
以后 npm install express Specify is used by default(淘宝)镜像
3、通过npm配置文件直接修改,essence and2条一样,配置文件位置(windows环境)为C盘下的.npmrc文件(Baidu can easily find the file path),MAC没试过.The configuration file location can be found with the following command
npm config ls -l
4、使用淘宝 NPM 镜像(参考 http://www.runoob.com/nodejs/nodejs-npm.html)
命令行输入
npm install -g cnpm --registry=https://registry.npm.taobao.org
这样就可以使用 cnpm 命令来安装模块了: cnpm install express
查看目前使用的npm镜像的方法:
npm config get registry
5、Set the download address of a single package(以包electron,其镜像https://npm.taobao.org/mirrors/electron/为例,参考https://reactnative.cn/docs/debugging/)
打开.npmrc,Add the specified mirror for this package,截图如下
6、If you want to change the mirror source back to a foreign source, you can directly change it.npmrc文件直接删除,You can restore it directly from the recycle bin when you want to restore it.
7、查看npmAll versions of the package on the source,以 babel-core 为例:
npm view babel-core versions
8、安装包的最新版本,包含beta版,以 babel-core 为例:
npm install [email protected]
9、查看package-lock.jsonin the specific dependency tree(with open source librariestar为例):
npm ls tar
npmcache and global package locations(默认情况)
可以通过命令行”npm config get cache”获取缓存目录,This command can also be used for global paths”npm root -g”
mac下: /Users/apple/.npmrc (“apple”是自己的mac用户名)
window下:%APPDATA%/npm/node_modules
npm源管理工具:
nrm:npm install -g nrm
参考:
1、https://www.jianshu.com/p/e953bd426368
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/127518.html原文链接:https://javaforall.cn
边栏推荐
- 1161. 最大层内元素和 : 层序遍历运用题
- 最新神作!阿里巴巴刚出炉的面试参考指南(泰山版),我直接狂刷29天
- The article you worked so hard to write may not be your original
- Istio介绍
- Kotlin coroutines: continuation, continuation interceptor, scheduler
- MySQL---Subqueries
- 华为手机一键开启“维修模式”隐藏所有数据,让手机隐私更加安全
- This 985 professor is on fire!After 10 years of Ph.D. supervisor, no one has graduated with a Ph.D.!
- 无主复制系统(2)-读写quorum
- [TypeScript] OOP
猜你喜欢
MySQL---多表查询
新型电信“套路”,我爸中招了!
flyway的快速入门教程
MySQL---Subqueries
AcWing 1282. 搜索关键词 题解((AC自动机)Trie+KMP)+bfs)
自动化测试—web自动化—selenium初识
九齐ny3p系列语音芯片替代国产方案KT148A性价比更高420秒长度
This 985 professor is on fire!After 10 years of Ph.D. supervisor, no one has graduated with a Ph.D.!
Combinatorics Notes (6) Associative Algebra of Locally Finite Partially Ordered Sets, Möbius Inversion Formula
Go basic part study notes
随机推荐
Combinatorics Notes (6) Associative Algebra of Locally Finite Partially Ordered Sets, Möbius Inversion Formula
Three. Introduction to js
学生管理系统第一天:完成登录退出操作逻辑 PyQt5 + MySQL5.8
多线程之锁
Golang go-redis cluster模式下不断创建新连接,效率下降问题解决
【Yugong Series】July 2022 Go Teaching Course 023-List of Go Containers
iNeuOS工业互联网操作系统,设备运维业务和“低代码”表单开发工具
【愚公系列】2022年07月 Go教学课程 020-Go容器之数组
flyway的快速入门教程
[Network Communication 3] Advantech Gateway Modbus Service Settings
【Yugong Series】July 2022 Go Teaching Course 021-Slicing Operation of Go Containers
每日练习------随机产生一个1-100之间的整数,看能几次猜中。要求:猜的次数不能超过7次,每次猜完之后都要提示“大了”或者“小了”。
无主复制系统(3)-Quorum一致性的局限性
京东获取商品历史价格信息 API
10 Ways to Keep Your Interface Data Safe
Concurrency, Timing and Relativity
Chinese encoding Settings and action methods return values
Three.js入门
MySQL---多表查询
微信小程序的路由拦截