简体   繁体   English

Node.js Expres.js Heroku Toolbelt> Foreman Start - 错误:编写EINVAL

[英]Node.js Expres.js Heroku Toolbelt >Foreman Start - Error: write EINVAL

This is the error I encountered with package.json when running foreman start with Heroku Toolbelt for Node.js 这是我在使用Heroku Toolbelt for Node.js运行foreman start时遇到的package.json错误

 "dependencies": 
{
    "express": "~4.4.0",
    "jade": "~1.3.1"
}

在此输入图像描述

I had the same issues as Jek. 我和Jek有同样的问题。 I was using express 4.4.4. 我使用快递4.4.4。 I downgraded express 3.2.6 and it worked, but I shouldn't be forced to use an older version of express just because foreman doesn't support it. 我降级快递3.2.6并且它有效,但我不应该因为工头不支持它而被迫使用旧版本的快递。

I tried node-foreman . 我试过节点工头 And it worked for me. 它对我有用。 I followed the instructions that included these steps: 我按照包含这些步骤的说明进行操作:

  1. npm install -g foreman npm install -g foreman
  2. nf start 从一开始

I would like to know if anyone has additional suggestions. 我想知道是否有人有其他建议。

I managed to fix this issue by changing express version to 3.2.6 as seen below 我设法通过将Express版本更改为3.2.6来解决此问题,如下所示

 "dependencies": 
{
    "express": "~3.2.6",
    "jade": "~1.3.1"
}

Then I deleted node_modules and did a npm install. 然后我删除了node_modules并进行了npm安装。 Following this a foreman start works perfectly fine. 在此之后,工头开始工作完全正常。

However I have no idea why it doesn't work when it runs on express 4 but it works when running on express 3. 但是我不知道为什么它在Express 4上运行时不起作用,但它在express 3上运行时有效。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM