简体   繁体   English

安装angular / cli时发生奇怪的错误

[英]strange error while installing angular/cli

I am creating an angular development environment in window 8.1 platforms. 我正在Windows 8.1平台中创建一个角度开发环境。 this machine has node 0.10.36 and npm version is 1.4.8 这台机器的节点为0.10.36,npm版本为1.4.8。

while installing angular/cli, I am getting this error 在安装angular / cli时,出现此错误

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 我想也许我应该卸载node和npm并重新安装它,以便我通过在“ C:\\ Users \\ Admin \\ AppData \\ Roaming”中找到npm来删除npm文件夹,但是当我键入npm --v时,我仍然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: 这些路径取决于您的OS和CPU体系结构,这些路径可能存在或可能不存在:

    • C:\\Program Files (x86)\\Nodejs C:\\ Program档案(x86)\\ Nodejs
    • C:\\Program Files\\Nodejs C:\\ Program Files \\ Nodejs
    • C:\\Users{User}\\AppData\\Roaming\\npm (or %appdata%\\npm) C:\\ Users {User} \\ AppData \\ Roaming \\ npm(或%appdata%\\ npm)
    • C:\\Users{User}\\AppData\\Roaming\\npm-cache (or %appdata%\\npm-cache) C:\\ Users {User} \\ AppData \\ Roaming \\ npm-cache(或%appdata%\\ npm-cache)
    • C:\\Users{User}.npmrc (and possibly check for that without the . prefix too) C:\\ Users {User} .npmrc(可能也检查不带。前缀的那个)
  4. Check your %PATH% environment variable to ensure no references to Nodejs or npm exist. 检查您的%PATH%环境变量,以确保不存在对Nodejs或npm的引用。

  5. Reboot the system and reinstall node JS. 重新引导系统并重新安装节点JS。

Using NVM multiple versions of node js can be maintained 使用NVM可以维护节点js的多个版本

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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