[英]Npm install fail with node 15 ( Not LTS ) "@angular-devkit/build-angular": "~0.1000.0"
npm install fail with below dependency "@angular-devkit/build-angular": sample package.json npm 安装失败,依赖项为“@angular-devkit/build-angular”:示例 package.json
{
"name": "myApp",
"version": "0.0.1",
"devDependencies": {
"@angular-devkit/build-angular": "~0.1000.0"
}
}
I am using node V15.5.1 npm v7.3.0我正在使用节点 V15.5.1 npm v7.3.0
I'm getting below errors:我收到以下错误:
npm ERR: Found.
npm 错误:已找到。 typescript@4.0.5 npm ERR.
打字稿@4.0.5 npm 错误。 node_modules/typescript npm ERR.
节点模块/打字稿 npm 错误。 peer typescript@">=3.9 <4.1" from @angular/compiler-cli@10.2.4 npm ERR.
来自@angular/compiler-cli@10.2.4 npm ERR 的 peer typescript@">=3.9 <4.1"。 node_modules/@angular/compiler-cli npm ERR.
node_modules/@angular/compiler-cli npm 错误。 peer @angular/compiler-cli@">=10.0.0-next.0 < 11" from @angular-devkit/build-angular@0.1000.8 npm ERR!
peer @angular/compiler-cli@">=10.0.0-next.0 < 11" from @angular-devkit/build-angular@0.1000.8 npm 错误!
node_modules/@angular-devkit/build-angular npm ERR: npm ERR.node_modules/@angular-devkit/build-angular npm ERR:npm ERR。 Could not resolve dependency.
无法解决依赖关系。 npm ERR.
npm 错误。 peer typescript@">=3.9 < 3.10" from @angular-devkit/build-angular@0.1000.8 npm ERR!
来自@angular-devkit/build-angular@0.1000.8 npm 的同行打字稿@">=3.9 < 3.10" 错误! node_modules/@angular-devkit/build-angular
node_modules/@angular-devkit/build-angular
not sure why node/npm is looking for typescript 4.0.5 instead of the version that can suit both the ranges.不确定为什么 node/npm 正在寻找 typescript 4.0.5 而不是适合这两个范围的版本。 (peer typescript@">=3.9 <4.1" and peer typescript@">=3.9 < 3.10" ) is this working as expected.
(peer typescript@">=3.9 <4.1" and peer typescript@">=3.9 < 3.10" ) 是否按预期工作。
i can able to run the npm install with --legacy-peer-deps flag.我可以使用--legacy-peer-deps标志运行 npm 安装。
is this a problem or its working as designed.这是一个问题还是它按设计工作。 why cant npm choose the version which suits both cases
为什么不能 npm 选择适合两种情况的版本
Use LTS version of node, currently 14.15.4.使用节点的 LTS 版本,当前为 14.15.4。 Changing the version depends on your OS and package manager, but at least on MacOS and Homebrew it goes like this:
更改版本取决于您的操作系统和 package 管理器,但至少在 MacOS 和 Homebrew 上它是这样的:
brew update
brew install node@14
brew link --overwrite node@14
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.