Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm start returns error 127 while setting up angular-seed application

I am trying to setup angular-seed application.

I have installed nodejs with sudo apt-get install nodejs

Installed npm with sudo apt-get install npm

Installed bower with sudo apt-get install bower -g

Installed nodejs-legacy with sudo apt-get install nodejs-legacy

Opened my angular-seed application, ran npm install. This ran perfectly without any errors.

To start the server, I'm trying to use npm start, but it is returning the following information and error.

> [email protected] prestart /home/venki/Downloads/angular-seed
> npm install


> [email protected] postinstall /home/venki/Downloads/angular-seed
> bower install


> [email protected] start /home/venki/Downloads/angular-seed
> http-server -a localhost -p 8000 -c-1

sh: 1: http-server: not found
npm ERR! weird error 127
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! not ok code 0

I'm using Ubuntu 14.04 LTS. Please let me know if any further information is necessary.

like image 332
atman Avatar asked Jan 21 '15 07:01

atman


3 Answers

I assumed that http-server will be installed by default by nodejs but it turns out that it doesn't.

I installed http-server using

sudo npm install -g http-server

Just ran npm start after this. That's it, the problem is solved.

like image 94
atman Avatar answered Nov 12 '22 03:11

atman


I had to run both the following commands;

sudo npm install -g http-server

apt-get install nodejs-legacy

And then my program trying to use NPM operated correctly.

like image 33
SethYes Avatar answered Nov 12 '22 03:11

SethYes


I installed nodejs-legacy using the following:

apt-get install nodejs-legacy

Then just run npm after this.

like image 29
Yogesh Chauhan Avatar answered Nov 12 '22 05:11

Yogesh Chauhan