Joalien
Joalien

Reputation: 86

Cannot install angular cli with npm

I have followed the documentation here to install angualar cli

When I run the command in an empty directory $ npm install -g @angular/cli I got the following error :

npm ERR! code ETARGET
npm ERR! notarget No matching version found for semver@^7.3.5.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget 
npm ERR! notarget It was specified as a dependency of '@npmcli/git'
npm ERR! notarget 

npm ERR! A complete log of this run can be found in:
npm ERR!     ~/.npm/_logs/2021-06-11T14_50_50_128Z-debug.log

However semver7.3.5 can be found here

I don't understand why I get this error, does someone have the answer ?

$ node -v
v14.16.1
$ npm -v
6.14.12
$ cat ~
283 verbose stack semver: No matching version found for semver@^7.3.5.
283 verbose stack     at pickManifest (~/node-v14.16.1-linux-x64/lib/node_modules/npm/node_modules/npm-pick-manifest/index.js:122:13)
283 verbose stack     at ~/node-v14.16.1-linux-x64/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/manifest.js:24:14
283 verbose stack     at tryCatcher (~/node-v14.16.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
283 verbose stack     at Promise._settlePromiseFromHandler (~/node-v14.16.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:517:31)
283 verbose stack     at Promise._settlePromise (~/node-v14.16.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:574:18)
283 verbose stack     at Promise._settlePromiseCtx (~/node-v14.16.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:611:10)
283 verbose stack     at _drainQueueStep (~/node-v14.16.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:142:12)
283 verbose stack     at _drainQueue (~/node-v14.16.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:131:9)
283 verbose stack     at Async._drainQueues (~/node-v14.16.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:147:5)
283 verbose stack     at Immediate.Async.drainQueues [as _onImmediate] (~/node-v14.16.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
283 verbose stack     at processImmediate (internal/timers.js:461:21)
284 verbose cwd ~/tevc/manufacture-poc/manufacturer-angular
285 verbose Linux 4.4.0-210-generic
286 verbose argv "~/node-v14.16.1-linux-x64/bin/node" "~/node-v14.16.1-linux-x64/bin/npm" "install" "-g" "@angular/cli"
287 verbose node v14.16.1
288 verbose npm  v6.14.12
289 error code ETARGET
290 error notarget No matching version found for semver@^7.3.5.
291 error notarget In most cases you or one of your dependencies are requesting
291 error notarget a package version that doesn't exist.
291 error notarget
291 error notarget It was specified as a dependency of '@npmcli/git'
292 verbose exit [ 1, true ]

EDIT

I have a custom npm registry

Upvotes: 2

Views: 710

Answers (1)

Joalien
Joalien

Reputation: 86

I had a custom registry defined here ~/.npmrc

Removing that registry allowed me to install @angular/cli successfully

Upvotes: 2

Related Questions