- Più recenti
- Maggior numero di voti
- Maggior numero di commenti
There's some bug in npm v7+, it uses a lot of memory and is slower when "node_modules" doesn't exist yet. See this answer: https://github.com/npm/cli/issues/3208#issuecomment-1002990902
The solution is to create node_modules in a prebuild hook:
mkdir node_modules
and install manually in predeploy hook (elastic beanstalk will bail out of installing if node_modules already exists) predeploy:
npm install --omit=dev
Note, we need to split in 2 steps, because elasticbeanstalk installs the target node version in the middle and run npm install
immediately.
I know it's too late, but anyway.
I had the same problem: the app was successfully deployed to elastic beanstalk with node v14 but failed with no adequate error while deploying to node v16.
The problem was the lack of memory. For some reason, npm v8 (which is installed with node v16) uses more memory while packages installing than npm v6 (which is installed with node v14). I haven't investigated the reason yet.
Changing the tier from 1GB RAM to 2GB RAM solved the issue.
The beanstalk node script really need to be updated to use --omit=dev
Contenuto pertinente
- AWS UFFICIALEAggiornata 2 anni fa
- AWS UFFICIALEAggiornata 6 mesi fa
- AWS UFFICIALEAggiornata 8 mesi fa
For me, it also helped to increase the build server to more RAM. The annoying part was that there is no error message or anything and I just noticed it accidentally.