npm install -g angular-cli sh:1:node:not found

前端之家收集整理的这篇文章主要介绍了npm install -g angular-cli sh:1:node:not found前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
  1. npm install -g @angular/cli

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

  1. /home/user1/.npm-packages/bin/ng -> /home/user1/.npm-packages/lib/node_modules/@angular/cli/bin/ng
  2.  
  3. > node-sass@4.5.0 install /home/user1/.npm-packages/lib/node_modules/@angular/cli/node_modules/node-sass
  4. > node scripts/install.js
  5.  
  6. sh: 1: node: not found
  7. /home/user1/.npm-packages/lib
  8. └── (empty)
  9.  
  10. npm WARN optional Skipping Failed optional dependency /@angular/cli/chokidar/fsevents:
  11. npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.17
  12. npm WARN @angular/core@2.4.6 requires a peer of rxjs@^5.0.1 but none was installed.
  13. npm ERR! Linux 4.8.0-22-generic
  14. npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "@angular/cli"
  15. npm ERR! node v4.2.6
  16. npm ERR! npm v3.5.2
  17. npm ERR! file sh
  18. npm ERR! code ELIFECYCLE
  19. npm ERR! errno ENOENT
  20. npm ERR! syscall spawn
  21.  
  22. npm ERR! node-sass@4.5.0 install: `node scripts/install.js`
  23. npm ERR! spawn ENOENT
  24. npm ERR!
  25. npm ERR! Failed at the node-sass@4.5.0 install script 'node scripts/install.js'.

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

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

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

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

猜你在找的Angularjs相关文章