【发布时间】:2026-02-03 20:30:01
【问题描述】:
我在将我的 nodejs 应用程序部署到 Heroku 时遇到问题。我尝试直接 git push(heroku cli),也尝试从 github deploy,但都失败了。我得到了这里的日志:
-----> Building on the Heroku-20 stack
-----> Determining which buildpack to use for this app
-----> Node.js app detected
jq: error (at <stdin>:19): Cannot index string with string "iojs"
! Push rejected, failed to compile Node.js app.
! Push failed
我试图检查 devdependents 是否是罪魁祸首,然后尝试更改 devdependents 包并删除所有“可能”导致失败的 node_modules 文件,但重试后,我仍然面临这个问题。我还尝试将引擎从 17.x 更改为 16.x,但仍然存在。
也许有人可以给我一个线索?
下面的 package.json 我有:
{
"name": "coupling",
"version": "1.0.0",
"engines": "17.x",
"description": "",
"main": "server.js",
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@vercel/node": "^1.12.1",
"csv-parser": "^3.0.0",
"express": "4.17.2",
"ws": "^8.4.2"
}
}
【问题讨论】:
标签: node.js heroku deployment