npm start命令给出错误:找不到http-server:命令,代码:ELIFECYCLE

时间:2016-09-29 11:46:43

标签: node.js npm centos npm-start

我是节点js的新手。开始设置节点js项目。

使用npm start命令时出错。

npm start

> sigma@1.1.0 start /usr/local/UserProfile/TitanUI
> http-server -p 8080    
sh: http-server: command not found    
npm ERR! Linux 2.6.32-504.8.1.el6.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! node v6.7.0
npm ERR! npm  v3.10.3
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! sigma@1.1.0 start: `http-server -p 8080`
npm ERR! spawn ENOENT
npm ERR! Failed at the sigma@1.1.0 start script 'http-server -p 8080'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the sigma package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     http-server -p 8080
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs sigma
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls sigma
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR!     /usr/local/UserProfile/TitanUI/npm-debug.log

这些是centos,npm和node js的版本。

centos的:6.6

NPM:3.10

的NodeJS:6.7.0 我想我只有最新版本。如果有人知道,请帮助我。

1 个答案:

答案 0 :(得分:0)

删除了node modules文件夹并运行" npm install"和" npm start"再次。这解决了上述错误。谢谢!