解决npm install卡在idealTree:npm: sill idealTree buildDeps的问题
背景介绍
使用 npm install
安装依赖时,一直卡在 idealTree: sill idealTree buildDeps
的问题。
解决方案
1. 更换npm镜像源
将npm镜像源更换为国内的镜像,加快安装速度。可以使用以下命令:
npm config set registry https://registry.npmmirror.com
yarn config set registry https://registry.npmmirror.com
通过以下命令确认是否修改成功:
npm config get registry
yarn config get registry
2. 清理缓存后重新安装
清理npm缓存,并重新安装依赖包:
npm cache clean --force
npm install
3. 切换到淘宝镜像源
如果更换镜像源后仍有问题,可以尝试切换到淘宝的npm镜像源:
npm config set registry https://registry.npm.taobao.org
npm install
4. 检查Node.js和npm版本
确保Node.js和npm的版本是最新的,可以通过以下命令检查和更新:
node -v
npm -v
npm install -g npm