npm i报错

 一、原因:npm无法找到路径,路径错误,请详细查看路径,确保是在有packjson文件打开的。

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\DELL\Desktop\gt/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\DELL\Desktop\gt\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\DELL\AppData\Local\npm-cache\_logs\2023-07-21T02_24_35_383Z-debug-0.log  

二、原因:因为vue@3.2.45和ruoyi@3.8.5不一样,版本不兼容,导致出错

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: ruoyi@3.8.5
npm ERR! Found: vue@3.2.45
npm ERR! node_modules/vue
npm ERR!   vue@"3.2.45" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer vue@"^2.2.0" from @riophae/vue-treeselect@0.4.0
npm ERR! node_modules/@riophae/vue-treeselect
npm ERR!   dev @riophae/vue-treeselect@"0.4.0" from the root project
npm ERR! 
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.
npm ERR! 
npm ERR! 
npm ERR! For a full report see:
npm ERR! C:\Users\DELL\AppData\Local\npm-cache\_logs\2023-07-21T02_28_42_945Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\DELL\AppData\Local\npm-cache\_logs\2023-07-21T02_28_42_945Z-debug-0.log

解决:

1.npm i --force 或者 npm i --legacy-peer-deps(强制性,可能会损坏)

2.修改vue版本和若依版本一致。在package.json文件中的dependencies和devDependencies修改版本(较为温和,可能会导致vue版本和其他内部elementplus、webpack等版本兼容问题,修改更多)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值