简体   繁体   English

npm 安装:无法解析依赖树

[英]npm Install : unable to resolve dependency tree

Eveytime i try npm install i go this errors it is a boilerplate project is downloaded from: https://as.netboilerplate.com/Templates . Eveytime 我尝试npm install我 go 这个错误它是一个样板项目下载自: https://as.netboilerplate.com/Templates I cant generate node_modules folder or start the server it s only on these boilerpart projects.any suggestions please im really tired.我无法生成 node_modules 文件夹或仅在这些样板项目上启动服务器。请给我任何建议,我真的很累。 here is a screenshot of the issue issue Screenshot这是问题截图

also here is some versions of my environment:这也是我的环境的一些版本:

npm: '8.3.1',node: '16.14.0',Angular CLI: 13.2.3



>   Package                      Version
> ------------------------------------------------------ @angular-devkit/architect    0.1302.3 (cli-only) @angular-devkit/core 
> 13.2.3 (cli-only) @angular-devkit/schematics   13.2.3 (cli-only) @schematics/angular          13.2.3 (cli-only)

The problem solved.问题解决了。 .It was after running npm install --legacy-peer-deps before getting the error again,a bunch of warnings were shown telling me that the project must use .它是在运行npm install --legacy-peer-deps之前再次出现错误,显示了一堆警告告诉我该项目必须使用

npm version: 6.11.0 and node version >=14.0 so i had to switch into those older versions and it s done. npm version: 6.11.0node version >=14.0所以我不得不切换到那些旧版本并且完成了。

Looks like that template is expecting you to use yarn (not npm).看起来该模板希望您使用纱线(而不是 npm)。 You need to get yarn and then, in the terminal (instead of npm install ), you do yarn to install the packages.您需要获取 yarn,然后在终端(而不是npm install )中执行yarn来安装包。

By the way, the tip off that it's expecting you to use yarn is the presence of the yarn.lock file.顺便说一句,它希望您使用 yarn 的提示是yarn.lock文件的存在。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM