首页 前端知识 npm install报错npm ERR! Maximum call stack size exceeded

npm install报错npm ERR! Maximum call stack size exceeded

2025-03-20 12:03:56 前端知识 前端哥 621 852 我要收藏

npm install报错npm ERR! Maximum call stack size exceeded

报错1

npm ERR! Maximum call stack size exceeded
复制

报错2

npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding failed, reason: connect ETIMEDOUT 104.16.29.34:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
复制

原因:电脑开了代理
解决:关闭代理

报错3

npm ERR! code ETIMEDOUTnpm ERR! syscall connectnpm ERR!errno ETIMEDOUT
复制

报错4

ERROR Failed to compile with 1 error 下午3:14:49
error in ./src/main.js
复制

在这里插入图片描述

解决方案

1、首先检查nodejs和npm版本是否最新

注意:vscode中npm版本和cmd中的npm版本可能存在不一致,如果不一致,重启vscode或者重启电脑再重启vscode
在这里插入图片描述

2、镜像不合适

2.1、查看npm镜像设置

npm config get registry
复制

2.2、将npm设置为淘宝镜像

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

2.3、再次查看npm镜像设置

npm config get registry
复制
3、忽略npm证书验证问题(npm安装完成后,再设置回true即可)
npm config set strict-ssl false
复制
4、删除package-lock.json和node_modules,清理缓存
npm cache clean --force
复制
5、安装
npm i
复制
6、启动报错时,具体问题具体分析,如报错4,则执行具体安装命令即可,此处缺少eslint-plugin-standard
npm install eslint-plugin-standard --save-dev
复制
7、启动
npm run dev
复制
转载请注明出处或者链接地址:https://www.qianduange.cn//article/24180.html
标签
评论
发布的文章

【Linux笔记】基础IO(上)

2025-03-27 13:03:40

大家推荐的文章
会员中心 联系我 留言建议 回顶部
娴忚鍣ㄥ崌绾ф彁绀猴細鎮ㄧ殑娴忚鍣ㄧ増鏈緝浣庯紝寤鸿鎮ㄧ珛鍗冲崌绾т负鐭ヤ簡鏋侀€熸祻瑙堝櫒锛屾瀬閫熴€佸畨鍏ㄣ€佺畝绾︼紝涓婄綉閫熷害鏇村揩锛�绔嬪嵆涓嬭浇
复制成功!