Solvedangular cli ERR! 404 Not Found : angular-cli@latest

Hello, I'm having trouble installing angular in my machine (Windows 7). I've already tried to install using @angular/cli ou angular-cli and it always gives the same error mentioned in the title.

npm ERR! code E404
npm ERR! 404 Not Found : angular-cli@latest

This is the log that was generated :
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'angular-cli' ]
2 info using npm@5.0.3
3 info using node@v8.1.0
4 verbose config Skipping project config: C:\Users\gabriel.paixao/.npmrc. (matches userconfig)
5 verbose npm-session b7f4ec783d7755a0
6 silly install loadCurrentTree
7 silly install readLocalPackageData
8 http fetch GET 404 http://registry.npmjs.org/angular-cli 39ms
9 silly fetchPackageMetaData error for angular-cli@latest 404 Not Found: angular-cli@latest
10 verbose stack Error: 404 Not Found: angular-cli@latest
10 verbose stack at fetch.then.res (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\lib\fetchers\registry\fetch.js:41:19)
10 verbose stack at tryCatcher (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
10 verbose stack at Promise._settlePromiseFromHandler (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:512:31)
10 verbose stack at Promise._settlePromise (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:569:18)
10 verbose stack at Promise._settlePromise0 (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:614:10)
10 verbose stack at Promise._settlePromises (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\promise.js:693:18)
10 verbose stack at Async._drainQueue (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:133:16)
10 verbose stack at Async._drainQueues (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:143:10)
10 verbose stack at Immediate.Async.drainQueues (C:\Program Files\nodejs\node_modules\npm\node_modules\bluebird\js\release\async.js:17:14)
10 verbose stack at runCallback (timers.js:800:20)
10 verbose stack at tryOnImmediate (timers.js:762:5)
10 verbose stack at processImmediate [as _immediateCallback] (timers.js:733:5)
11 verbose cwd C:\Users\gabriel.paixao
12 verbose Windows_NT 6.1.7601
13 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "angular-cli"
14 verbose node v8.1.0
15 verbose npm v5.0.3
16 error code E404
17 error 404 Not Found: angular-cli@latest
18 verbose exit [ 1, true ]

32 Answers

✔️Accepted Answer

Hi.

You should set your npm registry to main repo if you changed it to another one:

npm set registry https://registry.npmjs.org/

Other Answers:

To install the Angular CLI you will want to run...

npm install -g @angular/angular-cli

This is documented here: https://github.com/angular/angular-cli/blob/master/README.md#installation

If you're having an issue with that, please post the logs here.

NVM uses ~/.nvm/.npmrc instead of ~/.npmrc.
npm set registry https://registry.npmjs.org/ adds its entry to ~/.npmrc.
Moving the line registry=https://registry.npmjs.org/ to ~/.nvm/npmrc made it work for me.

More Issues: