npm太慢, 修改npm镜像

今天晚上想要将clone下来的项目进行npm install,但是等了半天都没动

查看源

npm config get registry

npm config list

https://registry.npmjs.org/国外的节点

每次用npm的,因为走国外的镜像,非常的慢

通过改变默认npm镜像代理服务,可以大幅提升安装速度

方法:

1.命令行指定(临时)

npm --registry https://registry.npm.taobao.org info underscore 

说明:

  这种方式是在使用命令时,添加 --registry https://registry.npm.taobao.org 

  如:

    npm install  express --registry=https://registry.npm.taobao.org

    安装express,使用淘宝源

2.通过config命令(长久)

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

查看

npm info underscore

3.通过cnpm使用

  cnpm 定制的命令行工具可以代替 npm

npm install -g cnpm --registry=https://registry.npm.taobao.org

使用cnpm

npm info underscore

 

cnpm install xxx

eg:

  cnpm install express

 修改了镜像源,安装就非常快了

posted @   慕尘  阅读(16631)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
点击右上角即可分享
微信分享提示