在将nodejs应用程序部署到Heroku时,我遇到了一个问题。我试图直接推git (heroku cli),也尝试使用github部署,但都失败了。这是我拿到的日志:
-----> 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我试图检查可能是dev依赖方是罪魁祸首,然后尝试更改dev依赖程序包并删除“可能”导致失败的所有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"
}
}发布于 2022-02-05 14:29:46
您的engines部分无效:
"engines": "17.x",Its value should be an , not a string。试一试:
"engines": {
"node": "17.x"
}https://stackoverflow.com/questions/70916605
复制相似问题