简体   繁体   中英

strange error while installing angular/cli

I am creating an angular development environment in window 8.1 platforms. this machine has node 0.10.36 and npm version is 1.4.8

while installing angular/cli, I am getting this error

C:\Users\Admin>npm install -g @angular/cli
npm WARN `git config --get remote.origin.url` returned wrong result (git://githu
b.com/angular/cli)
npm WARN `git config --get remote.origin.url` returned wrong result (git@github.
com:angular/cli)
npm ERR! git clone git@github.com:angular/cli Cloning into bare repository 'C:\U
sers\Admin\AppData\Roaming\npm-cache\_git-remotes\git-github-com-angular-cli-515
723dd'...
npm ERR! git clone git@github.com:angular/cli Host key verification failed.
npm ERR! git clone git@github.com:angular/cli fatal: Could not read from remote
repository.
npm ERR! git clone git@github.com:angular/cli
npm ERR! git clone git@github.com:angular/cli Please make sure you have the corr
ect access rights
npm ERR! git clone git@github.com:angular/cli and the repository exists.
npm ERR! addLocal Could not install angular/cli
npm ERR! Error: ENOENT, stat 'C:\Users\Admin\angular\cli'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "@angular/cl
i"
npm ERR! cwd C:\Users\Admin
npm ERR! node -v v0.10.36
npm ERR! npm -v 1.4.28
npm ERR! path C:\Users\Admin\angular\cli
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Users\Admin\npm-debug.log
npm ERR! not ok code 0

I thought maybe I should uninstall node and npm and install it again so for that I have deleted npm folder by going n there "C:\\Users\\Admin\\AppData\\Roaming" but still when I type npm --v, I am getting 1.4.28

Try to follow below steps

  1. Uninstall from Programs & Features from control panel.

  2. Reboot (or you probably can get away with killing all node-related processes from Task Manager).

  3. Look for these folders and remove them (and their contents) if any still exist. These paths are dependent upon your OS and CPU architecture, these may or may not exist:

    • C:\\Program Files (x86)\\Nodejs
    • C:\\Program Files\\Nodejs
    • C:\\Users{User}\\AppData\\Roaming\\npm (or %appdata%\\npm)
    • C:\\Users{User}\\AppData\\Roaming\\npm-cache (or %appdata%\\npm-cache)
    • C:\\Users{User}.npmrc (and possibly check for that without the . prefix too)
  4. Check your %PATH% environment variable to ensure no references to Nodejs or npm exist.

  5. Reboot the system and reinstall node JS.

Using NVM multiple versions of node js can be maintained

https://medium.com/appseed-io/how-to-run-multiple-versions-of-node-js-with-nvm-for-windows-ffbe5c7a2b47

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM