[英]NPM ELIFECYCLE error - using node server.js command
I am deploying test-bot on ibm watson as described here https://github.com/eciggaar/text-bot and 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! text-bot@0.1.2 start: `node server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the text-bot@0.1.2 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\_logs\2017-06-29T13_36_22_995Z-debug.log
Sometimes, when you already started your web server, the ELIFECYCLE
error comes if you try to run the npm
command again on another terminal (cmd).有时,当您已经启动了 Web 服务器时,如果您尝试在另一个终端 (cmd) 上再次运行
npm
命令, ELIFECYCLE
出现ELIFECYCLE
错误。 Make sure that you don't have any other instance running up in the same port .确保您没有任何其他实例在同一端口中运行。
Try to clean your cache with: npm cache clean
with Administrator/root and delete your node_modules
, after this steps, try to install your packages again with npm install --save
尝试使用以下命令清理缓存:
npm cache clean
with Administrator/root并删除您的node_modules
,在此步骤之后,尝试使用npm install --save
再次安装您的软件包
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 存在于应用程序目录中。
If clearing the cache does not work, this step may.如果清除缓存不起作用,这一步可以。 Try and kill the process running on the specific port (let's say 3000).
尝试终止在特定端口(假设为 3000)上运行的进程。 It worked in my situation.
它适用于我的情况。 Type the below in your terminal and also ensure you are in the correct directory too.
在您的终端中输入以下内容,并确保您也在正确的目录中。
lsof -n -i4TCP:3000 | grep LISTEN | tr -s ' ' | cut -f 2 -d ' ' | xargs kill -9
Best of luck !!祝你好运!!
In case you used Windows OS the PATH Environment variable was not including the directory of "node".如果您使用 Windows 操作系统,则 PATH 环境变量不包括“节点”目录。 Check it and add it.
检查它并添加它。 Maybe it helps.
也许它有帮助。
Regards问候
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.