angular - npm 安装-g angular-cli sh : 1: node: not found

标签 angular ubuntu sass

npm install -g @angular/cli

尝试在 ubuntu 16.10 中安装 angular-cli,我在 sass 上遇到以下错误。

/home/user1/.npm-packages/bin/ng -> /home/user1/.npm-packages/lib/node_modules/@angular/cli/bin/ng

> node-sass@4.5.0 install /home/user1/.npm-packages/lib/node_modules/@angular/cli/node_modules/node-sass
> node scripts/install.js

sh: 1: node: not found
/home/user1/.npm-packages/lib
└── (empty)

npm WARN optional Skipping failed optional dependency /@angular/cli/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.17
npm WARN @angular/core@2.4.6 requires a peer of rxjs@^5.0.1 but none was installed.
npm ERR! Linux 4.8.0-22-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.0 install: `node scripts/install.js`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the node-sass@4.5.0 install script 'node scripts/install.js'.

注意:我在一台新机器上,第一次设置 npm/angular。

最佳答案

原来 sass 仍然期望 /usr/bin/ 中的 node

创建链接,通过执行以下操作解决了问题

sudo ln -s /usr/bin/nodejs /usr/bin/node

关于angular - npm 安装-g angular-cli sh : 1: node: not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42064643/

相关文章:

css - Jeet Grid 与奇点

css - 在紧凑输出中将规则组合在一起?

css - 用于上传重叠在按钮上方的图像的 span 元素

angular - 如何获取 Angular ng-bootstrap 断点

javascript - 避免重新渲染子组件 NgRx - Firestore

javascript - 在api上提交表单的post方法

c++ - 加载 PEM 格式证书

linux - Ubuntu:允许非 root 用户创建和模拟用户

asp.net-core - 502 Bad Gateway 在 Ubuntu 20.04 上的 NGINX 上运行 ASP .NET Core 5 站点

angular - 如何在 typescript 构造函数中将数组对象转换为字符串?