设置角度种子应用程序时,npm start返回错误127

时间:2015-01-21 07:50:49

标签: angularjs node.js ubuntu npm bower

我正在尝试设置angular-seed application

我已经使用sudo apt-get install nodejs

安装了nodejs

使用sudo apt-get install npm

安装npm

安装了包含sudo apt-get install bower -g

的凉亭

使用sudo apt-get install nodejs-legacy

安装了nodejs-legacy

打开我的angular-seed应用程序,运行npm install。这完美运行没有任何错误。

要启动服务器,我正在尝试使用npm start,但它会返回以下信息和错误。

> angular-seed@0.0.0 prestart /home/venki/Downloads/angular-seed
> npm install


> angular-seed@0.0.0 postinstall /home/venki/Downloads/angular-seed
> bower install


> angular-seed@0.0.0 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

我正在使用Ubuntu 14.04 LTS。如果有任何进一步的信息,请告诉我。

3 个答案:

答案 0 :(得分:7)

我假设netjs默认会安装http-server,但事实证明它并没有。

我使用

安装了http-server
sudo npm install -g http-server

在此之后刚开始运行npm。就是这样,问题就解决了。

答案 1 :(得分:6)

我使用以下内容安装了nodejs-legacy

apt-get install nodejs-legacy

此后只是跑了npm。你应该在浏览器上获得你的应用程序。

答案 2 :(得分:6)

我必须运行以下两个命令;

sudo npm install -g http-server

apt-get install nodejs-legacy

然后我的程序尝试使用NPM正确运行。