问题(产生该问题的主要原因是因为本地的npm版本太高了)
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: nuxt-ssr@1.0.0
npm ERR! Found: jest@24.9.0
npm ERR! node_modules/jest
npm ERR! dev jest@"^24.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer jest@"26.x" from vue-jest@4.0.1
npm ERR! node_modules/vue-jest
npm ERR! dev vue-jest@"^4.0.0-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进行降级
npx -p npm@6 npm i --legacy-peer-deps
运行完后会生成一个 package-lock.json 的文件,该文件主要作用就是锁定安装包的版本号,以确保项目其他成员在npm install时大家的依赖一致。
操作完以上步骤重新npm i 就能安装成功了