Closed iamclaytonray closed 6 years ago
To keep the original issue cleaner, I added the environment from the EC2 instance, not my local machine. Everything works fine on my machine. It's just in production that it fails
We follow the Node.js release schedule which recently moved to 8.x as an active LTS version. Therefore, Nest 5 supports >= 8.9.0 as the lowest version now. This shift gave us sustainable performance boosts thanks to the es2017 target of the TypeScript compilation.
Sorry for not responding to this. I see that now. Maybe you can make this a little more prominent and let users know that if they want to run the latest version of Nest in prod, they need to use containers (docker, etc) or another option?
As far as I know, EBS supports Node.js 8.x
I managed to get it to work after a lot of trial and error using the https://github.com/nestjs/typescript-starter.
In main.ts file, change line 6 await app.listen(3000);
to await app.listen(process.env.PORT || 8000);
I used ebs cli instead of uploading a zip, this is the key.
For configuration, like @kamilmysliwiec use Node 8+, I used 8.11.3, the latest they have. The default node command needs to be overridden with npm run start:prod
I was unaware of changing the node version. Where is that specifically? The only place I saw to change Node had the highest version being at 6.x.x
I have everything else set for prod. Database URIs, ports, etc
Click modify under the Software box
Thanks!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
I'm submitting a...
Current behavior
When trying to deploy a Nest server to Elastic Beanstalk, I get an error returned that I put in a code block below. I've tried different TypeScript configurations, different regions, and a whole bunch of other things. Nothing has worked and the error message hasn't changed.
Expected behavior
Ideally, I should be able to ship to prod with no issues from Nest itself. Any issues I have should come from any bugs I write.
Minimal reproduction of the problem with instructions
Here is a repo that you can use
Assuming you have the AWS/EBS CLI installed, here are some instructions:
eb init
(Select options manually)eb create
(Select options manually)Here is the error from running
eb logs
:What is the motivation / use case for changing the behavior?
To be able to ship to prod with no issues.
Environment