简体   繁体   English

NPM ELIFECYCLE 错误 - 使用 node server.js 命令

[英]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.也许它有帮助。

  1. Check with echo %PATH%检查 echo %PATH%
  2. And then add it with set PATH=%PATH;然后用 set PATH=%PATH; 添加它
  3. Then try the installation again然后再次尝试安装

Regards问候

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试使用 Node.js MSSQL 连接到 SQL 服务器数据库时出现错误 ELIFECYCLE 3228369023 - Error ELIFECYCLE 3228369023 on attempted connection to SQL Server database using Node.js MSSQL 节点 server.js 没有响应 - node server.js not responding 如何修复节点服务器错误 npm ERR? 代码 ELIFECYCLE npm 错误! 错误1? - How do I fix a node server error, npm ERR! code ELIFECYCLE npm ERR! errno 1? 在 Windows 的命令行中运行 node server.js 时,为什么会出现语法错误或服务器未定义错误? - Why am I getting a syntax error or server not defined error when running node server.js in command line for windows? 节点 server.js 抛出错误 - 找不到模块 - Node server.js throws error - Cannot find module 节点server.js没有响应并出现错误消息 - Node server.js not responding and thows error message 在节点 js“应该设置秘密”和反应“npm ERR!代码 ELIFECYCLE”中出现错误 - Getting error in node js "secret should be set" and in react "npm ERR! code ELIFECYCLE" Node.js - 在Server.js上执行Node命令(Express + React + Webpack) - Node.js - Executing Node command on Server.js (Express + React + Webpack) 启动脚本不适用于 npm start,但适用于 node server.js - start script not working with npm start, but works fine with node server.js ELIFECYCLE Node.js错误,如何解决? - Error with ELIFECYCLE Node.js, how correct this?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM