ELIFECYCLE Node.js 错误是什么意思?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30744964/
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
What does the ELIFECYCLE Node.js error mean?
提问by Sam
What does ELIFECYCLE mean?
生命周期是什么意思?
Here's my app code: https://gist.github.com/samholmes/388ca4552c5936b52c5d
这是我的应用程序代码:https: //gist.github.com/samholmes/388ca4552c5936b52c5d
When I run the 'blast-emails' command, it will run for a while until shortly crashing with the error:
当我运行“blast-emails”命令时,它会运行一段时间,直到很快崩溃并出现错误:
npm ERR! Linux 3.2.0-4-amd64
npm ERR! argv "/root/.nvm/versions/io.js/v1.6.1/bin/iojs" "/root/.nvm/versions/io.js/v1.6.1/bin/npm" "run" "live"
npm ERR! node v1.6.1
npm ERR! npm v2.7.1
npm ERR! code ELIFECYCLE
npm ERR! [email protected] live: `NODE_ENV=production node app.js`
npm ERR! Exit status 137
npm ERR!
npm ERR! Failed at the [email protected] live script 'NODE_ENV=production node app.js'.
npm ERR! This is most likely a problem with the emailer package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! NODE_ENV=production node app.js
npm ERR! You can get their info via:
npm ERR! npm owner ls emailer
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /apps/emailer/npm-debug.log
The npm-debug.logfile is also included in the gist.
该npm-debug.log文件也包含在要点中。
I'm looking for one of two answers: What does ELIFECYCLE mean? (or) Why am I getting the error in my application code?
我正在寻找两个答案之一:ELIFECYCLE 是什么意思?(或)为什么我的应用程序代码中出现错误?
回答by Pierre Inglebert
回答by Daniel W.
One might think this is because outdated versions of npm and node, but it's not the case.
有人可能认为这是因为 npm 和 node 版本过时,但事实并非如此。
Just as Pierre Inglebert says, if you look into the source you can see that End of lifecyclemeans the program unexpectedlystopped. This can have various reasons. So it's not a syntax error and not an expected exception/error.
正如 Pierre Inglebert 所说,如果您查看源代码,您会发现这End of lifecycle意味着程序意外停止。这可能有多种原因。所以这不是语法错误,也不是预期的异常/错误。
The error appeared to me when a different tool was already using the http port (3000) defined in my node scripts. When you run your node app on port 80, make sure you have stopped Apache webserver (as an example).
当一个不同的工具已经在使用我的节点脚本中定义的 http 端口 (3000) 时,我看到了这个错误。在端口 80 上运行节点应用程序时,请确保已停止 Apache 网络服务器(例如)。
回答by adam-asdf
While working on a WordPress theme, I got the same ELIFECYCLEerror with slightly different output:
在处理 WordPress 主题时,我遇到了相同的ELIFECYCLE错误,但输出略有不同:
npm ERR! Darwin 14.5.0 npm ERR! argv "/usr/local/Cellar/node/7.6.0/bin/node" "/usr/local/bin/npm" "install" npm ERR! node v7.6.0 npm ERR! npm v3.7.3 npm ERR! code ELIFECYCLE npm ERR! [email protected] postinstall: `bower install && gulp build` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] postinstall script 'bower install && gulp build'. 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 foundationsix package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! bower install && gulp build
After trying npm installone more time with the same result, I tried bower install. When that was successful I tried gulp buildand that also worked.
在npm install以相同的结果再次尝试后,我尝试了bower install. 当这成功时,我尝试过gulp build并且也奏效了。
Everything is working just fine now. No idea why running each command separately worked when &&failed but maybe someone else will find this answer useful.
现在一切正常。不知道为什么在&&失败时单独运行每个命令会起作用,但也许其他人会发现这个答案很有用。
回答by Mardari
In my case, it was because of low RAM memory, when a photo compression library was unable to process bigger photos.
就我而言,这是因为内存不足,照片压缩库无法处理更大的照片。
回答by Magne
If you came here like I did, after receiving a similar error when trying the React Getting Started guide, you might like to know that the problem could have been caused by not having installed Watchman. Download it here, or install it with Homebrew with brew install watchmanand try again: https://facebook.github.io/watchman/docs/install.html
如果你像我一样来到这里,在尝试React 入门指南时收到类似的错误后,你可能想知道问题可能是由于没有安装 Watchman 引起的。在此处下载,或使用 Homebrew 安装并重brew install watchman试:https: //facebook.github.io/watchman/docs/install.html
PS: You might want to do a brew updatefirst.
PS:你可能想先做一个brew update。
回答by Moh K
at process._tickCallback (internal/process/next_tick.js:10 4:9) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] sample: `node src/server/dat a/seed-db.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] sample script. npm ERR! This is probably not a problem with npm. There is lik ely additional logging output above. npm ERR! A complete log of this run can be found in:
I have the same issue here is how I got solved finally!
the error:
my error from the terminal when i run npm run sampleafter correcting my database connection username and passwordI was using mlab for my database and under the file .env i forget to properly put the user name and password. When I correct that I works.
我在这里有同样的问题是我最终是如何解决的!错误:
我npm run sample在更正数据库连接用户名和密码后运行时出现终端错误我使用 mlab 作为我的数据库,在文件 .env 下我忘记正确输入用户名和密码。当我纠正我的工作时。
> [email protected] sample /Users/mohammedr.kemal/Downl oads/Ex_Files_ANGULAR_API_AUTH/Exercise Files/Ch01/01_04/start > node src/server/data/seed-db.js connected to mongodb... connected to mongodb... 2 records inserted. closing connection... done. 12 records inserted. closing connection... done.
So it might be good to look any data connection we made in our code if we have.
因此,如果有的话,最好查看我们在代码中建立的任何数据连接。
回答by ahmadalibaloch
When running Webpack build I was getting similar error because node doesn't understand asyncawaitkeywords on older versions. I added webpack babel-plugin-transform-async-to-generatorand it was solved. This replaces them with promises.
在运行 Webpack 构建时,我遇到了类似的错误,因为节点不理解asyncawait旧版本上的关键字。我添加了 webpack babel-plugin-transform-async-to-generator并解决了。这用承诺代替了它们。
回答by Roman
I had the same error after I installed new packages or updated them:
安装新软件包或更新它们后,我遇到了同样的错误:
...
npm ERR! code ELIFECYCLE
npm ERR! errno 1
...
It helped me to run installation command once again or a couple of times. After that, the error disappeared.
它帮助我再次或几次运行安装命令。之后,错误消失了。
回答by Laura Smith
I had this issue when I was running two projects that had the same set up and I already had one running. This meant that the other project couldn't use that port number. As soon as I stopped the other project running I had no issues.
当我运行两个具有相同设置的项目并且我已经运行了一个时,我遇到了这个问题。这意味着另一个项目不能使用该端口号。一旦我停止运行另一个项目,我就没有问题。
回答by a_m_dev
In my case it was permission problem with Linux, instead of writing:
就我而言,这是 Linux 的权限问题,而不是写:
npm run start
I tried:
我试过:
sudo npm run start
Then put your sudo user password and you're good to go!
然后输入您的 sudo 用户密码,您就可以开始了!

