首页 前端知识 npm install 卡住不动的六种解决方法

npm install 卡住不动的六种解决方法

2024-05-28 09:05:52 前端知识 前端哥 931 838 我要收藏

1.重装

检查网络设置,删除node_modules重新npm install

2. 配置npm代理

//  配置nmp代理来提高速度,如设置淘宝镜像
npm config set registry https://registry.npm.taobao.org
 
// 查看配置是否成功
npm config get registry
 
// 成功后重新npm install安装
npm install

3.使用nrm来管理npm镜像源

// 全局安装nrm (mac需要加上sudo)
npm install -g nrm
 
// 查看可配置的源列表
nrm ls
 
// 使用配置列表中的源
nrm use taobao

// 成功后重新npm install安装
npm install

4.使用cnpm来安装

// 全局安装cnpm (mac需要加上sudo)
npm install cnpm -g --registry=https://registry.npmmirror.com
 
// 成功后使用cnpm install安装
cnpm install

5.使用yarn来安装

// 全局安装yarn (mac需要加上sudo)
npm install -g yarn
 
// 成功后使用yarn install安装
yarn install

6.使用pnpm来安装

// 全局安装pnpm
npm install -g pnpm

// 成功后使用pnpm install安装
pnpm install

参考

npm install 时,卡住不动,五种解决方法

转载请注明出处或者链接地址:https://www.qianduange.cn//article/9787.html
标签
评论
发布的文章
大家推荐的文章
会员中心 联系我 留言建议 回顶部
复制成功!