I have been trying to install Angular CLI on my Windows system.
I am new to this, and have been following steps given in https://angular-templates.io/tutorials/about/learn-angular-from-scratch-step-by-step to setup my environment. Since I am using Windows, I used "nodist" NVM method to install node and npm on my system. I can successfully run both these commands hinting to the fact that perhaps npm and node have been installed correctly -
C:\WINDOWS\system32>npm -v
1.2.24
C:\WINDOWS\system32>node -v
v0.10.9
Now, to install Angular CLI, I ran -
C:\WINDOWS\system32>npm install -g @angular/cli
npm ERR! addLocal Could not install angular/cli
npm ERR! Error: ENOENT, stat 'C:\WINDOWS\system32\angular\cli'
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <[email protected]>
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "@angular/cli"
npm ERR! cwd C:\WINDOWS\system32
npm ERR! node -v v0.10.9
npm ERR! npm -v 1.2.24
npm ERR! path C:\WINDOWS\system32\angular\cli
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\WINDOWS\system32\npm-debug.log
npm ERR! not ok code 0
I tried creating a folder 'C:\WINDOWS\system32\angular\cli'. Also, tried cleaning cache and retrying. But none of it helped.
Edit :
Okay I tried setting up through the installer file mentioned in one of the comments, and now I have node version - "10.16.3" and npm version - "6.9.0". But running the mentioned command for installing angular-cli gives me this error :
C:\WINDOWS\system32>npm i -g @angular/cli
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! FetchError: request to http://registry.npmjs.org/@angular%2fcli failed, reason: connect ECONNREFUSED 104.16.18.35:80
npm ERR! at ClientRequest.req.on.err (C:\Users\comviva\AppData\Roaming\nvm\v0.10.9\node_modules\npm\node_modules\node-fetch-npm\src\index.js:68:14)
npm ERR! at ClientRequest.emit (events.js:198:13)
npm ERR! at Socket.socketErrorListener (_http_client.js:392:9)
npm ERR! at Socket.emit (events.js:198:13)
npm ERR! at emitErrorNT (internal/streams/destroy.js:91:8)
npm ERR! at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
npm ERR! at process._tickCallback (internal/process/next_tick.js:63:19)
Also, I am using a system at my office. And looking up the proxy settings at "Change Proxy Settings" on Windows, I don't see any Proxy server being used.
It looks like you have the wrong node version or the overall installation file. You can get the working version of node here https://nodejs.org/en/ and choose the recommended version for most users. go through the installation process and after that just run npm i -g @angular/cli
.