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

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%2fplugin-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
  • 5
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值