Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

npm install -g @angular/cli

trying to install angular-cli in ubuntu 16.10 and I face the following error on sass.

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

> [email protected] 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: [email protected]
npm WARN @angular/[email protected] 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! [email protected] install: `node scripts/install.js`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node scripts/install.js'.

Note: I'm on a fresh machine, setting up npm/angular for the first time.

like image 983
Anand Rockzz Avatar asked Feb 06 '17 09:02

Anand Rockzz


1 Answers

Turns out sass still expects node in /usr/bin/

Creating a link, by doing the following resolved the issue

sudo ln -s /usr/bin/nodejs /usr/bin/node
like image 185
Anand Rockzz Avatar answered Sep 30 '22 05:09

Anand Rockzz