首页 > 其他分享 >npm安装插件时遇到:npm ERR! code ERESOLVE或者 code ERESOLVE npm ERR! 错误

npm安装插件时遇到:npm ERR! code ERESOLVE或者 code ERESOLVE npm ERR! 错误

时间:2024-02-21 19:23:13浏览次数:40  
标签:npm code ERR vue eslint ERESOLVE

1.问题

我们在使用npm install ...时,遇到以下问题:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @vue/[email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint-plugin-vue
npm ERR! dev eslint-plugin-vue@"^8.0.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint-plugin-vue@"^7.0.0" from @vue/[email protected]
npm ERR! node_modules/@vue/eslint-config-standard
npm ERR! dev @vue/eslint-config-standard@"^6.1.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/eslint-plugin-vue
npm ERR! peer eslint-plugin-vue@"^7.0.0" from @vue/[email protected]
npm ERR! node_modules/@vue/eslint-config-standard
npm ERR! dev @vue/eslint-config-standard@"^6.1.0" from the root project
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

2.解决方法

参考:npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! Vue开发中安装库经常报错
解决方案:
在安装内容的命令后面加上

--legacy-peer-deps

如:
PS E:\web\project-SHP\app\src> npm i less-loader --legacy-peer-deps
added 1 package in 2s

3.补充

运行过程中报错:Module build failed: Error: Cannot find module ‘less’
用上述方式安装 less即可

PS E:\web\project-SHP\app> npm install less --legacy-peer-deps

added 13 packages in 3s
// 成功运行
App running at:

4.补充

项目开发过程中报错:code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While Vuex中dispatch没有被定义
在一般情况下书写没有任何问题的时候,观察vue版本和vuex版本是否出现了差错,重新安装vuex的版本即可

5.补充:

项目运行时控制台报错:Refused to apply style from ‘http://localhost:8080/iconfont.css’ because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled.

查看自己项目文件夹中是否进行引入了iconfont.css文件,有的话进行注销即可

标签:npm,code,ERR,vue,eslint,ERESOLVE
From: https://www.cnblogs.com/trmbh12/p/18026038

相关文章

  • nvm:npm和node版本冲突以及淘宝证书过期导致的错误
    1.问题1.ERROR:npmv10.4.0isknownnottorunonNode.jsv14.7.0.Thisversionofnpmsupportsthefollowingnodeversions:^18.17.0||>=20.5.0.2.Couldnotretrievehttps://npm.taobao.org/mirrors/node/latest/SHASUMS256.txt2.解决2.1问题一:npm和Node版本......
  • 2024年!vscode和clangd的配置
    前言Ubuntu20系统下,使用vscode和clangd来进行代码补全和拼写检查.安装vscode直接从Ubuntu的应用商店下载vscode.安装clangd$sudoaptinstallclangd安装vscode插件-clangdvscode安装clangd插件不需要对clangd插件进行配置.不需要对clangd插件进......
  • Weblogic XMLDecoder反序列化漏洞(CVE-2017-10271)复现
    0x00漏洞简介OracleFusionMiddleware(Oracle融合中间件)是美国甲骨文(Oracle)公司的一套面向企业和云环境的业务创新平台。该平台提供了中间件、软件集合等功能。OracleWebLogicServer是其中的一个适用于云环境和传统环境的应用服务器组件。OracleFusionMiddleware中的Oracle......
  • npm安装私服
    1、安装verdaccio(加上–unsafe-perm的原因是防止报grywarn权限的错)npminstall-gverdaccio--unsafe-perm2、启动verdaccio3、其他命令配置文件刷新verdaccio-cconfig.yaml4、利用pm2一直守护verdaccio进程npminstall-gpm2--unsafe-perm5、以守护的方式......
  • python2 解决 unicode转中文问题
    importjson#避免\x0e问题importsysreload(sys)sys.setdefaultencoding('utf-8')#defbbb():#bbb={u"111":u"\u73bb\u7483"}printbbbprint(json.dumps(bbb).decode("unicode-escape"))de......
  • npm i canvas 报错 [email protected] run install node-pre-gyp install --fallback-to-b
    今天在写项目的时候安装npmicanvas的时候一直报错。具体错误如下npmERR!commandfailednpmERR!commandC:\Windows\system32\cmd.exe/d/s/cnode-pre-gypinstall--fallback-to-build--update-binarynpmERR!node-pre-gypinfoitworkedifitendswithoknpmE......
  • subprocess中的return_code与poll
    subprocess中的return_code与pollp=subprocess.Popen('ping8.8.8.8',shell=True,stdout=subprocess.PIPE,stderror=subprocess.DEVNULL)whilenotp.poll():#p.poll()即为return_codeprint(p.stdout.read().decode())#return_code=p.poll()#......
  • encodeURI和encodeURIComponent的区别?
    在JavaScript中,encodeURI()和encodeURIComponent()是用于对URI进行编码的两个方法,它们可以将URI中的特殊字符进行转义,以便在URL中安全地传输和显示。encodeURI()方法用于对整个URI进行编码,除了常见的字符(字母、数字、-、_、.、!、~、*、'、(、))外,不会对其他字符......
  • npm 报错 npm ERR! request to https://registry.npm.taobao.org/three failed, reaso
    1.问题描述npm使用淘宝镜像安装报错npmERR!codeCERT_HAS_EXPIREDnpmERR!errnoCERT_HAS_EXPIREDnpmERR!requesttohttps://registry.npm.taobao.org/xxxfailed,reason:certificatehasexpired2.错误原因错误提示已经告诉原因是淘宝镜像过期了!其实,早在2021......
  • Rust 编译报 spurious network error (1 tries remaining): [7] Couldn't connect to
    现象:当执行 cargobuild时报类似错误:warning:spuriousnetworkerror(3triesremaining):[7]Couldn'tconnecttoserver(Failedtoconnectto127.0.0.1port8899after2040ms:Couldn'tconnecttoserver);class=Net(12)warning:spuriousnetworkerror......