NPM N8N Unable to update since version 0.222.0

Describe the problem/error/question

Installed n8n with npm. Works fine for quite some time. Trying to update since last week like described here Release notes | n8n Docs but n8n is just not updating, just stuck at version 0.222.0
I did uninstall and clean reinstall on the same machine and surprisingly it is still the old version 0.222.0

What is the error message (if any)?

No error messages at all


## Information on your n8n setup
- **n8n version: 0.222.0
- **Database (default: SQLite): SQLite
- **n8n EXECUTIONS_PROCESS setting (default: own, main): dunno
- **Running n8n via (Docker, npm, n8n cloud, desktop app): npm
- **Operating system: Ubuntu

Hey @DanBoyDan,

Welcome to the community :tada:

Doing an uninstall and a reinstall should result in a new version, When you did your original install how did you do it? Are you using nvm and pm2 maybe?

1 Like

I did it exactly as it is described here - npm | n8n Docs
Used npm install n8n -g
Then tried to update at some point with npm update -g n8n
But nothing happens, no errors. The n8n version remains the same.
Today I removed n8n and then I did fresh install on the same machine using again npm install n8n -g. And after the new install it is still the same old version.

Hey @DanBoyDan,

That is unexpected, The version should be pulled from npm so I am not sure why npm is not working correctly but as a test it could be worth trying npm install n8n@latest -g to see if that sorts it out.

It would be worth making sure you run this as the same user that is starting n8n, How are you launching n8n? Just running n8n start won’t launch it as a service so I assume you are doing something to keep it running?

So just uninstalled with
sudo npm uninstall n8n --global
npm verb cli /usr/bin/node /usr/bin/npm
npm info using [email protected]
npm info using [email protected]
npm verb title npm uninstall n8n
npm verb argv “uninstall” “n8n” “–global” “–loglevel” “verbose”
npm verb logfile logs-max:10 dir:/root/.npm/_logs/2023-07-05T14_54_19_548Z-
npm verb logfile /root/.npm/_logs/2023-07-05T14_54_19_548Z-debug-0.log
removed 1426 packages in 8s
npm verb exit 0
npm info ok

Then fresh install with
npm install n8n@latest -g

Then
n8n --version
0.222.3

Logging in, same version in dashboard. As you said it seems npm is somehow not pulling last version. Or there might be other reasons too.

How are you launching n8n?
n8n start - as written in the docs

Just running n8n start won’t launch it as a service so I assume you are doing something to keep it running?
I start it manually whenever I need it.

That is very odd, I wonder if something is cached somewhere, The latest tag should be pulling in 0.234.1. Can you try npm cache clean --force or sudo npm cache clean --force if you are running the install with sudo.

Can you try npm cache clean --force or sudo npm cache clean --force if you are running the install with sudo.

sudo npm cache clean --force
npm WARN using --force Recommended protections disabled.

Did you try installing after that? What output do you get if you try npm outdated -g --depth=0 and also sudo npm outdated -g --depth=0, Would be interesting to see if the results are different

npm outdated -g --depth=0
Package Current Wanted Latest Location Depended by
corepack 0.17.0 0.19.0 0.19.0 node_modules/corepack global
npm 9.5.1 9.7.2 9.7.2 node_modules/npm global
Package Current Wanted Latest Location Depended by
corepack 0.17.0 0.19.0 0.19.0 node_modules/corepack global
npm 9.5.1 9.7.2 9.7.2 node_modules/npm global

sudo npm outdated -g --depth=0
Package Current Wanted Latest Location Depended by
corepack 0.17.0 0.19.0 0.19.0 node_modules/corepack global
npm 9.5.1 9.7.2 9.7.2 node_modules/npm global

Did you try installing after that?

Yes, it still loads same old version 0.222.3
But I just noticed something strange, I uninstall it with
npm uninstall n8n -g
And right after the uninstall that when I type
n8n start
it launches and works. It seems the uninstall is not working. Nor is the update.

Hey @DanBoyDan,

That sounds like there is an issue with your npm installation, What is odd is n8n doesn’t show when you run the outdated command which would suggest you may have more than one npm install.

As this is not an issue with n8n itself this is outside of our scope but I have a couple of ideas, When you installed npm how did you do it? Can you also run which n8n and which npm so we can see what the output is.