Reputation: 331
npm install fail with below dependency "@angular-devkit/build-angular" : sample 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
I'm getting below errors :
npm ERR! Found: [email protected] npm ERR! node_modules/typescript npm ERR! peer typescript@">=3.9 <4.1" from @angular/[email protected] npm ERR! node_modules/@angular/compiler-cli npm ERR! peer @angular/compiler-cli@">=10.0.0-next.0 < 11" from @angular-devkit/[email protected] npm ERR!
node_modules/@angular-devkit/build-angular npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer typescript@">=3.9 < 3.10" from @angular-devkit/[email protected] npm ERR! 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. (peer typescript@">=3.9 <4.1" and peer typescript@">=3.9 < 3.10" ) is this working as expected .
i can able to run the npm install with --legacy-peer-deps flag.
is this a problem or its working as designed . why cant npm choose the version which suits both cases
Upvotes: 0
Views: 1073
Reputation: 352
Use LTS version of node, currently 14.15.4. Changing the version depends on your OS and package manager, but at least on MacOS and Homebrew it goes like this:
brew update
brew install node@14
brew link --overwrite node@14
Upvotes: 0