Updaing n8n on AWS EC2 (Amazon Linux 2023) leads to problem with @msgpackr-extract/msgpackr-extract-darwin-x64?

Hi, I’m a newbie who has somehow worked out on installing a self-hosted n8n on AWS EC2 service. Without much background in software engineering, I have to admit that I’m not too sure about what I’m doing, but I try my best.

I have been able to have a running n8n v.0.236.3 through my own URL with something called like n8n.myDomain.com .
I tried to update the n8n to v1.0.5 through the console, with the following command:
sudo npm install -g [email protected]

And halfway through the installation, the console freezes here:

[ec2-user@ip-172-_______ .n8n]$ sudo npm install -g [email protected]
(#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠹ reify:@msgpackr-extract/msgpackr-extract-darwin-arm64: timing reifyNode:node_modules/n8n/node_modules/@msgpackr-extract/msgpackr-extract-darwin-x64 C(#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠹ reify:@msgpackr-extract/msgpackr-extract-darwin-arm64: timing reifyNode:node_modules/n8n/node_modules/@msgpackr-extract/msgpackr-extract-darwin-x64 C(#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠹ reify:@msgpackr-extract/msgpackr-extract-darwin-arm64: timing reifyNode:node_modules/n8n/node_modules/@msgpackr-extract/msgpackr-extract-darwin-x64 C(#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠹ reify:@msgpackr-extract/msgpackr-extract-darwin-arm64: timing reifyNode:node_modules/n8n/node_modules/@msgpackr-extract/msgpackr-extract-darwin-x64 C(#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠹ reify:@msgpackr-extract/msgpackr-extract-darwin-arm64: timing reifyNode:node_modules/n8n/node_modules/@msgpackr-extract/msgpackr-extract-darwin-x64 C(#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠦ reify:@msgpackr-extract/msgpackr-extract-darwin-arm64: timing reifyNode:node_modules/n8n/node_modules/@msgpackr-extract/msgpackr-extract-darwin-x64 C(#########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠦ reify:@msgpackr-extract/msgpackr-extract-darwin-arm64: timing reifyNode:node_modules/n8n/node_modules/@msgpackr-extract/msgpackr-extract-darwin-x64 Completed in 175ms

And then the console stopped being responsive.

I rebooted the instance, ran the following to clean up the previously failed installation.

sudo npm uninstall -g n8n # Uninstall the previously attempted installation
sudo npm cache clean -f # Clear the npm cache
sudo npm install -g npm
sudo npm install -g [email protected]

But it reached reached the same console freezing point again.

Interestingly, I had this same console freezing point when yesterday I tried updating my n8n to v.0.236.3, too (Unsure from which previous version).
Somehow it didn’t go well, so I did the same steps the next day, and somehow the issue was resolved and the installation to v.0.236.3 went smoothly.
Therefore I had thought that it was me doing some instructions wrong the other day, but today my console stopped at the same location despite me rebooting the instance two times.

The original n8n was installed using these code:

sudo yum install -y nodejs
node -v
sudo npm install -g n8n

Has anyone ran into something similar?


Edit: Half an hour after rebooting after this incident, the re-run of installation of the new version 1.0.5 was successful. It’s very strange that this took two tries, same as my experience before. Being once stuck at the msgpackr-extract-darwin was somewhat unavoidable. Quite strange.

[ec2-user@ip-172-___ ~]$ sudo npm install -g [email protected]
npm WARN deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
npm WARN deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
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]: The library contains critical security issues and should not be used for production! The maintenance of the project has been discontinued. Consider migrating your code to isolated-vm.
npm WARN deprecated [email protected]: Please switch to @apidevtools/json-schema-ref-parser
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.

added 1331 packages in 3m

162 packages are looking for funding
  run `npm fund` for details

Hey @kehebik612,

This is likely to be npm building a dependency on your machine and the ec2 instance might not have the power to do it quickly, I have had the same issue when using the lower powered digital ocean droplets.

2 Likes

I had a similar problem when I first tried to install n8n. I was using an AWS Lightsail instance with 1GB RAM. It just kept hanging up. When I ran another ssh session into the server during the install and watched the RAM using with the top command, it became obvious it was running out of RAM and just not coping with that. I added an 8GB swap file and the installation completed.

4 Likes

Would generally also always recommend to run n8n via Docker, rather than directly npm installed.

2 Likes

Hi @Jon, thanks for the tip. I’m a beginner and would like to ask a bit more (Sorry for reviving this old thread):
What do you mean that it might not have the “power” to do it?
Would that mean RAM, computing power, or something else?
I see that I have a 1GB RAM on the AWS EC2. If the n8n minimum requirement is 320 MB, what do you think is the reason that the update failed if the limitation could have come from the RAM (like CommuniG8 kind of hinted, but we’re not sure)?

Hi Jan,
Thank you for the tip. I wasn’t able to find any tutorial that was beginner-/non-software-engineer-friendly using docker, so I started learning using the npm. I hope that once I get more proficiency I could put together an easy guide for future beginners to install using Docker.

Thank you for your insight! That with the RAM limitation is a good hint. I already have 1GB and I’m not sure where to tune it on my instance (Quite noob). I did notice that the updates usually fail, but if I uninstall and re-install, the EC2 was able to handle it much better. Usually it always installs. Just update it tends to fail (85% crash rate for me). Strange.

Hey @kehebik612 the issues I have seen in the past come from the cpu power available so something like Lightsail I think offers up 0.25 vCPU for containers, I think EC2 still offers up at least 1 vCPU but it might be something low powered and if a package need to be built it can often have issues.