npm install -g angular-cli 失败 [英] npm install -g angular-cli fails

查看:64
本文介绍了npm install -g angular-cli 失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 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 错误!Linux 4.8.0-36-generic npm ERR!argv "/usr/bin/nodejs""/usr/bin/npm" "安装" "-g" "angular-cli" npm ERR!节点 v4.2.6 npm呃!npm v3.5.2 npm ERR!文件 sh npm 错误!代码 ELIFECYCLE npm ERR!errno ENOENT npm 错误!系统调用生成

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 错误!node-sass@4.5.2 安装:node scripts/install.js npm ERR!生成 ENOENT npm ERR!npm 错误!在 node-sass@4.5.2 安装失败脚本'节点脚本/install.js'.npm 错误!确保您拥有安装了最新版本的 node.js 和 npm.npm 错误!如果你这样做,这个很可能是 node-sass 包 npm ERR 的问题!不与npm 本身.npm 错误!告诉作者这在您的系统上失败:npm 错误!节点脚本/install.js npm ERR!你可以获得信息关于如何为这个项目打开一个问题:npm ERR!npm 错误node-sass npm ERR!或者,如果这不可用,您可以获取他们的信息通过: npm ERR!npm 所有者 ls node-sass npm ERR!有可能上面的附加日志输出.

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 错误!请在任何支持请求中包含以下文件:npm 错误!/home/matan/Projects/npm-debug.log npm ERR!代码 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆