gpt4 book ai didi

javascript - 来自 Heroku Toolbelt 的 Foreman 退出并出现错误 : write EINVAL every time

转载 作者:数据小太阳 更新时间:2023-10-29 05:12:35 26 4
gpt4 key购买 nike

关注 Heroku 的 Getting Started教程比我预期的要令人沮丧得多。我现在遇到的问题可能是配置问题,点击不到 10 次就可以解决,但我不知道这些点击是什么,这让我很困惑。

工头不会启动。我没有使用 Ruby、Heroku 或 Foreman 的经验,也几乎没有任何 Web 编程经验,所以我完全不知道这里发生了什么。这是我在运行 Windows 7 64 位时收到的错误消息:

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

Google 在躲避我。我无法通过任何搜索找到答案。我已经重新启动、重新安装、重写、重新复制、重读等,但我找不到解决方案。我的代码完全反射(reflect)了上面链接的入门页面上的代码,为方便起见,我将其粘贴在这里:

配置文件:

web: node web.js

web.js

var express = require("express");
var logfmt = require("logfmt");
var app = express();

app.use(logfmt.requestLogger());

app.get('/', function(req, res) {
res.send('Hello World!');
});

var port = Number(process.env.PORT || 5000);
app.listen(port, function() {
console.log("Listening on " + port);
});

packge.json

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

同样,我完全按照入门页面上应该做的一切进行了操作,但工头拒绝开始。这是怎么回事?

最佳答案

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

我和 Jek 有同样的问题。我正在使用 express 4.4.4。我降级了 express 3.2.6 并且它有效,但我不应该因为工头不支持而被迫使用旧版本的 express。

我试过了 node-foreman .它对我有用。我遵循了包含以下步骤的说明:

  1. npm install -g 工头
  2. 开始

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

关于javascript - 来自 Heroku Toolbelt 的 Foreman 退出并出现错误 : write EINVAL every time,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24310998/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com