2

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

6
  • Please share more details. Does the log file tell you more about the problem? Commented Jun 14, 2021 at 9:01
  • Try removing package-lock.json file first, then retry installing. Commented Jun 14, 2021 at 9:07
  • @NicoHaase I have share the log file Commented Jun 14, 2021 at 9:16
  • @AjinkyaBawaskar There is no package-lock.json as the directory is empty. I am trying to install angular cli to generate components. Do I need a package.json to install angular cli ? Commented Jun 14, 2021 at 9:17
  • 1
    @Akirus It works ! I gonna write the answer Commented Jun 14, 2021 at 9:31

1 Answer 1

2

I had a custom registry defined here ~/.npmrc

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.