今天新拉一个项目,npm时出现了各种诡异的报错。
又是出现这个报错,又是说node-sass版本不对(忘记截图了),一整个诡异住。
code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: ruoyi@3.8.3 npm ERR! Found: axios@0.24.0 npm ERR! node_modules/axios npm ERR! axios@"0.24.0" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer axios@"^0.21.1" from @smallwei/avue@2.10.5 npm ERR! node_modules/@smallwei/avue npm ERR! @smallwei/avue@"^2.8.23" 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.
使用--force也没用。最后发现,解决答案就存在报错中。
原因就是安装包各个版本冲突,使用npm i --legacy-peer-deps就可以解决了。