Node.js的Elastic Beanstalk环境错误:找不到模块'node-linux-arm64/package.json'。

0

【以下的问题经过翻译处理】 我在AWS Elastic Beanstalk上运行我的Node.js项目时遇到问题。

之前跑了几个月都是正常的,但圣诞假期后现在失败了。

以下是eb-engine.log文件的输出:

[INFO] 执行指令:使用NPM安装依赖
[INFO] 使用npm安装依赖
[INFO] 运行命令/bin/sh -c npm config set jobs 1
[INFO] 运行命令/bin/sh -c npm --production install

npm ERR! code 1
npm ERR! path /var/app/staging/node_modules/node
npm ERR! command failed
npm ERR! command sh -c node installArchSpecificPackage
npm ERR! node:internal/modules/cjs/loader:936
npm ERR! throw err;
npm ERR! ^
npm ERR!
npm ERR! Error: Cannot find module 'node-linux-arm64/package.json'
npm ERR! Require stack:
npm ERR! - /var/app/staging/node_modules/node/installArchSpecificPackage.js
npm ERR! at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
npm ERR! at Function.resolve (node:internal/modules/cjs/helpers:108:19)
npm ERR! at ChildProcess.<anonymous> (/var/app/staging/node_modules/node-bin-setup/index.js:19:27)
npm ERR! at ChildProcess.emit (node:events:527:28)
npm ERR! at maybeClose (node:internal/child_process:1092:16)
npm ERR! at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5) {
npm ERR! code: 'MODULE_NOT_FOUND',
npm ERR! requireStack: [
npm ERR! '/var/app/staging/node_modules/node/installArchSpecificPackage.js'
npm ERR! ]
npm ERR! }

使用的是“Node.js 16在64位Amazon Linux 2/5.6.3”平台。

任何帮助都将不胜感激。

profile picture
EXPERTE
gefragt vor 5 Monaten31 Aufrufe
1 Antwort
0

【以下的回答经过翻译处理】 希望如果有人遇到同样的问题,这能帮到他们。

这个问题是由我项目的一个依赖更新导致的。

在这个依赖的源代码中,它在其package.json中要求不同版本的node。

从我们的应用程序中移除这个模块的依赖解决了这个问题。

profile picture
EXPERTE
beantwortet vor 5 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen