在安装 node_modules 时,我使用--legacy-peer-deps或--force标志。这在我本地系统上的 Windows 上运行良好,但在 ubuntu 服务器中部署项目时不起作用!
这是我得到的错误:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @nestjs/mongoose@8.0.1
npm ERR! Found: mongoose@6.0.1
npm ERR! node_modules/mongoose
npm ERR! mongoose@"6.0.1" from the root project
npm ERR! mongoose@"*" from @types/mongoose@5.11.96
npm ERR! node_modules/@types/mongoose
npm ERR! dev @types/mongoose@"5.11.96" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer mongoose@"^5.11.15 || ^5.12.4" from @nestjs/mongoose@8.0.1
npm ERR! node_modules/@nestjs/mongoose
npm ERR! …Run Code Online (Sandbox Code Playgroud)