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

Ven*_*SGS 7 ubuntu node.js npm angularjs bower

我正在尝试设置角度种子应用程序.

我安装了nodejs sudo apt-get install nodejs

用npm安装 sudo apt-get install npm

安装凉亭用 sudo apt-get install bower -g

安装了nodejs-legacy with sudo apt-get install nodejs-legacy

跑了我的角种子应用程序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
Run Code Online (Sandbox Code Playgroud)

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

Ven*_*SGS 7

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

我安装了http-server

sudo npm install -g http-server
Run Code Online (Sandbox Code Playgroud)

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


小智 6

nodejs-legacy使用以下安装:

apt-get install nodejs-legacy
Run Code Online (Sandbox Code Playgroud)

不仅仅是跑npm了这个.你应该在浏览器上获得你的应用程序


小智 6

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

sudo npm install -g http-server

apt-get install nodejs-legacy
Run Code Online (Sandbox Code Playgroud)

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