npm install -g angular-cli失败 [英] npm install -g angular-cli fails
问题描述
我正在尝试在Linux上安装Angular CLI.我键入命令"npm install -g angular-cli",然后出现此错误:
I'm trying to install Angular CLI on linux. I type the command "npm install -g angular-cli" and I get this error:
npm ERR! Linux 4.8.0-36-通用npm ERR! argv"/usr/bin/nodejs" "/usr/bin/npm"安装""-g""angular-cli" npm ERR!节点v4.2.6 npm 呃! npm v3.5.2 npm错误!文件sh npm ERR!代码ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall生成
npm ERR! Linux 4.8.0-36-generic npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "angular-cli" npm ERR! node v4.2.6 npm ERR! npm v3.5.2 npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn
npm ERR! node-sass@4.5.2安装:node scripts/install.js
npm ERR!
产生ENOENT npm ERR! npm ERR!无法在node-sass@4.5.2安装
脚本节点脚本/install.js". npm ERR!确保您有
安装了最新版本的node.js和npm. npm ERR!如果这样做,这
很有可能是node-sass软件包npm ERR的问题!不与
npm本身. npm ERR!告诉作者这在您的系统上失败:
npm ERR!节点脚本/install.js npm错误!您可以获得信息
关于如何使用以下项目打开此项目的问题:npm ERR! npm错误
node-sass npm错误!或者,如果不可用,您可以获取他们的信息
通过:npm ERR! npm owner ls node-sass npm错误!有可能
上面的其他日志记录输出.
npm ERR! node-sass@4.5.2 install: node scripts/install.js
npm ERR!
spawn ENOENT npm ERR! npm ERR! Failed at the node-sass@4.5.2 install
script 'node scripts/install.js'. npm ERR! Make sure you have the
latest version of node.js and npm installed. npm ERR! If you do, this
is most likely a problem with the node-sass package, npm ERR! not with
npm itself. npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/install.js npm ERR! You can get information
on how to open an issue for this project with: npm ERR! npm bugs
node-sass npm ERR! Or if that isn't available, you can get their info
via: npm ERR! npm owner ls node-sass npm ERR! There is likely
additional logging output above.
npm ERR!请在任何支持请求中包括以下文件: npm ERR!/home/matan/Projects/npm-debug.log npm错误!代码1
npm ERR! Please include the following file with any support request: npm ERR! /home/matan/Projects/npm-debug.log npm ERR! code 1
我正在网上寻找更多信息,但没有找到任何解决方案.
I was looking for more info on the web, and I didn't find any solutions.
推荐答案
现在是:
npm install -g @angular/cli
此外,您还应该升级节点版本,您可以使用nvm拥有多个节点版本: https://github. com/creationix/nvm
Also you should upgrade your node version, you can have multiple node versions with nvm: https://github.com/creationix/nvm
这篇关于npm install -g angular-cli失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!