I use AWS for almost all of my infrastructure. For n8n I didn’t want to set up a whole Docker cluster, I just wanted to run n8n on a single EC2 instance.
I’m mainly posting to share that trying to install n8n on the latest Amazon Linux 2022 AMI created a slew of dependency errors that I couldn’t resolve. Installing on Ubuntu LTS 22.04 worked seamlessly out of the box.
This article (How to set up n8n via PM2 – n8n Blog) was very helpful setting up n8n to run as a service whenever the machine boots. Piece of cake. And looks like there are a lot of pm2 options that I haven’t explored yet.
Hopefully this post saves someone else some hassle getting up to speed with n8n on AWS.
I didn’t see anything in the instructions about n8n specifically wanting node 16. I tried with Node 19 and 18 before switching to Ubuntu. To be specific about the dependency errors I’d have to try again. Happy to do that & send you the output if it’d be helpful.
Also happy to try again with Node 16.
But if n8n is really meant for Node 16 the instructions should probably say that somewhere before they say “just enter npm install n8n”.
OK, well I don’t know what I did wrong last time because now it’s working fine with Node 18 and Node 19. Here are my notes from trying this again. Let me know if I should delete this thread so it doesn’t confuse people in the future.
1. Create t4g.large instance from AMI al2022-ami-2022.0.20221207.4-kernel-5.15-arm64 (ami-0a7f76080f6cdf1e5)
2. sudo yum upgrade
3. sudo yum install nodejs
4. sudo npm install -g [email protected]
5. node --version output is "v18.4.0"
6. sudo npm install n8n -g output is:
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated @types/[email protected]: This is a stub types definition. express-unless provides its own type definitions, so you do not need this installed.
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: Please switch to @apidevtools/json-schema-ref-parser
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
At this point n8n is installed and I am able to start it with no problems.
------------------------------------
7. curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
8. nvm install 19
9. nvm current output is "v19.4.0"
10. sudo npm install n8n -g output is essentially the same set of warnings but the install completes and I am able to start n8n.