Javascript NPM ELIFECYCLE 错误 - 使用 node server.js 命令
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/44845335/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
NPM ELIFECYCLE error - using node server.js command
提问by Prerna Chugh
I am deploying test-bot on ibm watson as described here https://github.com/eciggaar/text-botand when I am trying to deploy code locally using CLI foundry it is getting the following errors.
我正在 ibm watson 上部署 test-bot,如下所述https://github.com/eciggaar/text-bot并且当我尝试使用 CLI 代工厂在本地部署代码时,出现以下错误。
I am using Nodejs version 6.10.3 and npm version 5.0.4
我使用的是 Nodejs 版本 6.10.3 和 npm 版本 5.0.4
can someone please help me with this.
有人可以帮我解决这个问题吗?
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\PRERNA CHUGH\AppData\Roaming\npm-cache\_logs17-06-29T13_36_22_995Z-debug.log
回答by Sayuri Mizuguchi
Sometimes, when you already started your web server, the ELIFECYCLEerror comes if you try to run the npmcommand again on another terminal (cmd). Make sure that you don't have any other instance running up in the same port.
有时,当您已经启动了 Web 服务器时,ELIFECYCLE如果您尝试npm在另一个终端 (cmd) 上再次运行该命令,则会出现错误。确保您没有任何其他实例在同一端口中运行。
Try to clean your cache with: npm cache cleanwith Administrator/rootand delete your node_modules, after this steps, try to install your packages again with npm install --save
尝试使用以下方法清理缓存:npm cache clean使用Administrator/root并删除您的node_modules,在此步骤之后,尝试再次安装您的软件包npm install --save
回答by Pavan Nath
Check the mappings in package.json file.
检查 package.json 文件中的映射。
{
"name": "app",
"version": "1.0.0",
"description": "",
"main": "server.js",
"dependencies": {},
"scripts": {
"start": "node ."
},
"author": "",
"license": "ISC"
}
Make sure that server.js is present in the app directory.
确保 server.js 存在于应用程序目录中。
回答by georgiosn_1
In case you used Windows OS the PATH Environment variable was not including the directory of "node". Check it and add it. Maybe it helps.
如果您使用 Windows 操作系统,则 PATH 环境变量不包括“节点”目录。检查它并添加它。也许它有帮助。
- Check with echo %PATH%
- And then add it with set PATH=%PATH;
- Then try the installation again
- 检查 echo %PATH%
- 然后用 set PATH=%PATH; 添加它
- 然后再次尝试安装
Regards
问候

