小编Jin*_*var的帖子

将 Node.js Docker 从本地(Apple M1)推送到 Heroku 时,继续遇到相同的部署错误(Exec Format Error)

发布图像时出现错误

2021-04-07T06:30:58.443089+00:00 heroku[web.1]: Starting process with command `node index.js`
2021-04-07T06:31:01.899268+00:00 app[web.1]: Error: Exec format error
Run Code Online (Sandbox Code Playgroud)

我回到了只需要 Express 的最简单的 node.js 代码。无法理解它可能有什么问题。

设置如下:

  • 在 Mac (Apple M1) 上运行 Docker 桌面
  • 安装了最新的 Heroku、最新的 NPM、最新的 Node
  • 使用 VS 代码
  • dockerfile 设置:
WORKDIR /app
COPY package.json .
RUN npm install
COPY index.js .
CMD ["node", "index.js"]
Run Code Online (Sandbox Code Playgroud)
  • 包.json
{
  "name": "SigningV2",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "node index.js",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "", …
Run Code Online (Sandbox Code Playgroud)

heroku node.js docker apple-m1

3
推荐指数
2
解决办法
362
查看次数

标签 统计

apple-m1 ×1

docker ×1

heroku ×1

node.js ×1