EB deploy NodeJS app - npm failed to install dependencies

516 views Asked by At

appreciate any advice on below issue!

I am attempting to deploy an Node app to EB using eb deploy and--after the artifact is uploaded--am seeing errors in eb-engine log saying I didn't specify Node.js version and that npm failed to install dependencies.

Are the two issues related? Why does it think Node version is not specified? Is it possible to view the deploy artifacts on the EC2 instance to verify contents? I tried eb ssh, but I only have access to user home directory, which is empty.

Here's my package.json, which has Node version specified:

{
  "name": "test-web-app",
  "version": "1.0.0",
  "license": "MIT",
  "private": true,
  "scripts": {
    ...
  },
  "dependencies": {
    ...
  },
  "devDependencies": {
    ...
    },
  "engines": {
    "npm": ">=6.0.0",
    "node": ">=14.0.0"
  },
  "browserslist": []
}

    2022-03-30 21:44:02    INFO    Deploying new version to instance(s).
    2022-03-30 21:44:06    INFO    Instance deployment: You didn't specify a Node.js version in the 'package.json' file in your source bundle. The deployment didn't install a specific Node.js version.
    2022-03-30 21:47:28    INFO    Deleted log fragments for this environment.
    2022-03-30 21:52:55    ERROR   Instance deployment: 'npm' failed to install dependencies that you defined in 'package.json'. For details, see 'eb-engine.log'. The deployment failed.
    2022-03-30 21:52:55    ERROR   Instance deployment failed. For details, see 'eb-engine.log'.
    2022-03-30 21:52:58    ERROR   [Instance: i-0ddcd50e726593b52] Command failed on instance. Return code: 1 Output: Engine execution has encountered an error..
0

There are 0 answers