javascript – Foreman,来自Heroku Toolbelt,退出时出错:每次都写EINVAL

前端之家收集整理的这篇文章主要介绍了javascript – Foreman,来自Heroku Toolbelt,退出时出错:每次都写EINVAL前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
遵循Heroku的 Getting Started教程比我预期的更令人沮丧.我现在所拥有的可能是一个配置问题,它可以在不到10次点击的情况下解决,但我不知道这些点击是什么,它正在推动我的问题.

工头不会开始.我没有Ruby,Heroku或Foreman的经验,也没有任何网络编程经验,所以我完全不知道这里发生了什么.这是我得到的错误消息,运行Windows 7 64位:

  1. C:\Users\___________\hello_world_basics>foreman start
  2. 09:40:17 web.1 | started with pid 2408
  3. 09:40:18 web.1 | Listening on 5000
  4. 09:40:18 web.1 |
  5. 09:40:18 web.1 | Error: write EINVAL
  6. 09:40:18 web.1 | at errnoException (net.js:904:11)
  7. 09:40:18 web.1 | at Socket._write (net.js:645:26)
  8. 09:40:18 web.1 | at doWrite (_stream_writable.js:226:10)
  9. 09:40:18 web.1 | at writeOrBuffer (_stream_writable.js:216:5)
  10. 09:40:18 web.1 | at Socket.Writable.write (_stream_writable.js:183:11)
  11. 09:40:18 web.1 | at Socket.write (net.js:615:40)
  12. 09:40:18 web.1 | at Console.log (console.js:53:16)
  13. 09:40:18 web.1 | at Server.<anonymous> (C:\Users\___________\hello_world_basics\web.js:14:11)
  14. 09:40:18 web.1 | at Server.g (events.js:180:16)
  15. 09:40:18 web.1 | exited with code 8
  16. 09:40:18 system | sending SIGKILL to all processes
  17. 09:40:18 | at Server.EventEmitter.emit (events.js:92:17)

谷歌正在躲避我.任何搜索都无法找到答案.我重新启动,重新安装,重写,重新复制,重读等等,我找不到解决方案.我的代码完全反映了上面链接的“入门”页面上的代码,为方便起见,我将在此处粘贴:

Procfile:

  1. web: node web.js

web.js

  1. var express = require("express");
  2. var logfmt = require("logfmt");
  3. var app = express();
  4.  
  5. app.use(logfmt.requestLogger());
  6.  
  7. app.get('/',function(req,res) {
  8. res.send('Hello World!');
  9. });
  10.  
  11. var port = Number(process.env.PORT || 5000);
  12. app.listen(port,function() {
  13. console.log("Listening on " + port);
  14. });

packge.json

  1. {
  2. "name": "hello_world_basics","version": "0.0.0","description": "A simple hello world app.","main": "web.js","scripts": {
  3. "test": "echo \"Error: no test specified\" && exit 1"
  4. },"repository": {
  5. "type": "git","url": "git@heroku.com:hello_world_basics.git"
  6. },"keywords": [
  7. "twitter","quality","bestof"
  8. ],"author": "Lincoln Bergeson","license": "ISC","dependencies": {
  9. "logfmt": "^1.1.2","express": "^4.4.3"
  10. }
  11. }

再次,我完全按照“入门”页面上的内容进行操作,但是工头拒绝启动.这里发生了什么?

解决方法

这是一个类似的Stackoverflow Q / A:
Node.js Expres.js Heroku Toolbelt >Foreman Start – Error: write EINVAL

我和Jek有同样的问题.我使用快递4.4.4.我降级快递3.2.6并且它有效,但我不应该被迫使用较旧版本的快递,因为工头不支持它.

我尝试了node-foreman.它对我有用.我按照包含这些步骤的说明进行操作:

> npm install -g foreman
> nf开始

我想知道是否有人有其他建议.

猜你在找的JavaScript相关文章