I try to deploy a node.js app to Elastic Beanstalk and it fails on the deployment step, when I click Details on that step in AWS CodePipeline I get this:
EBS env status becomes degraded.
And, for some reason, when I try to fetch the logs on EBS it doesn't work.
But when I ssh into the instance and go to /var/log/ and vim into eb-engine.log I see the error message:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! canvas@2.6.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas@2.6.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-01-23T12_04_23_121Z-debug.log
2021/01/23 12:04:23.134856 [INFO] Executing cleanup logic
2021/01/23 12:04:23.134947 [INFO] CommandService Response: {"status":"FAILURE","api_version":"1.0","results":[{"status":"FAILURE","msg":"Engine execution has encountered an error.","returncode":1,"events":[{"msg":"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.","timestamp":1611403457,"severity":"INFO"},{"msg":"Instance deployment: 'npm' failed to install dependencies that you defined in 'package.json'. For details, see 'eb-engine.log'. The deployment failed.","timestamp":1611403463,"severity":"ERROR"},{"msg":"Instance deployment failed. For details, see 'eb-engine.log'.","timestamp":1611403463,"severity":"ERROR"}]}]}
2021/01/23 12:04:23.135107 [INFO] Platform Engine finished execution on command: app-deploy
It looks like canvas isn't installing and throwing the error. How can I fix it?
