我在尝试安装软件包时收到npm警告:
$ npm install
npm WARN @angular/compiler-cli@10.0.2 requires a peer of @angular/compiler@10.0.2 but none is installed. You must install peer dependencies yourself.
audited 1595 packages in 18.719s
58 packages are looking for funding
run `npm fund` for details
found 294 low severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
为了解决上述对等问题,我尝试安装该对等依赖项并收到以下警告:
$ npm install @angular/compiler@10.0.2
npm WARN @angular/platform-browser-dynamic@8.2.14 requires a peer of @angular/compiler@8.2.14 but none is installed. You must install peer dependencies yourself.
npm WARN codelyzer@5.2.1 requires a peer of @angular/compiler@>=2.3.1 <10.0.0 || >9.0.0-beta <10.0.0 || >9.1.0-beta <10.0.0 || >9.2.0-beta <10.0.0 but none is installed. You must install peer dependencies yourself.
+ @angular/compiler@10.0.2
added 1 package from 1 contributor, updated 1 package and audited 1596 packages in 15.701s
58 packages are looking for funding
run `npm fund` for details
found 294 low severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
有人可以帮我吗?
答案 0 :(得分:0)
您的package.json没有@angular/compiler@10.0.2
在这种情况下,某些库依赖于节点程序包中的其他库,例如在这种情况下,@angular/compiler-cli@10.0.2
是依赖的,或者使用了@angular/compiler@10.0.2
的某些功能。
只需将@angular/compiler@10^
添加到package.json
中,下次运行npm install时不会收到警告