当前位置:网站首页>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 express2、命令行永久更改使用指定镜像(淘宝)
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 -l4、使用淘宝 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 registry5、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 versions8、安装包的最新版本,包含beta版,以 babel-core 为例:
npm install [email protected]9、查看package-lock.jsonin the specific dependency tree(with open source librariestar为例):
npm ls tarnpmcache 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
边栏推荐
- 【网络通信三】研华网关Modbus服务设置
- 使用 Flutter 和 Firebase 制作!计数器应用程序
- 【Yugong Series】July 2022 Go Teaching Course 020-Array of Go Containers
- Get Douyin Video Details API
- Masterless replication system (1) - write DB when node fails
- Introduction of Jerry voice chip ic toy chip ic_AD14NAD15N full series development
- 抖音根据关键词取视频列表 API
- Bika LIMS 开源LIMS集—— SENAITE的使用(检测流程)
- TestCafe总结
- Golang 必知必会Go Mod命令
猜你喜欢
随机推荐
ECCV 2022 华科&ETH提出首个用于伪装实例分割的一阶段Transformer的框架OSFormer!代码已开源!...
如何才能真正的提高自己,成为一名出色的架构师?
All-platform GPU general AI video supplementary frame super-score tutorial
MATLAB程序设计与应用 2.4 MATLAB常用内部函数
Kotlin coroutines: continuation, continuation interceptor, scheduler
Write a database document management tool based on WPF repeating the wheel (1)
抖音根据关键词取视频列表 API
中文编码的设置与action方法的返回值
Combinatorics Notes (6) Associative Algebra of Locally Finite Partially Ordered Sets, Möbius Inversion Formula
Bika LIMS 开源LIMS集—— SENAITE的使用(检测流程)
Introduction of Jerry voice chip ic toy chip ic_AD14NAD15N full series development
go基础部分学习笔记记录
Flex布局详解
How programmers learn open source projects, this article tells you
matplotlib ax bar color 设置ax bar的颜色、 透明度、label legend
Get Douyin Video Details API
Verilog实现占空比为5/18的9分频
useragent怎么获取
多主复制下处理写冲突(3)-收敛至一致的状态及自定义冲突解决逻辑
Multi-datacenter operation and detection of concurrent writes









