Greetings!
We're currently running NodeBB v3.10.3 and I have been trying to upgrade to latest (v4.6.1 at the time of writing). I have not tried upgrading directly on the instance yet since I wanted to try locally first with the same or close-to-same conditions (node versions npm versions Ubuntu versions, latest DB backup, public files etc).
However, the upgrade script has been failing again and again and I even upgraded node to v22.21.0 and npm to v10.9.4.
The error always seem to be something along the lines of "Dependencies outdated or not yet installed. Error Code: DEP_WRONG_VERSION".
Then I followed the following instructions and have been able to "seemingly" upgrade NodeBB. However, I am not entirely sure if the process I followed is correct or if I have missed any steps that would run all the upgrade scripts like db migration/plugin upgrades etc.
Steps I followed are a follows:
Any feedback would be appreciated. Thank you!

3 Comments
yasas@community.nodebb.org · 4 pts · 222d
An update on this in case it helps anyone else: So there were some custom plugins that were installed via a local directory. The upgrade goes through without issues by performing the following before the upgrade:
package.jsonnode_modulesandpackage-lock.jsonare removedOnce upgraded,
package.jsonnpm installfollowed by./nodebb buildThis should fix the dependency issue if you have any custom plugins
baris@community.nodebb.org · 2 pts · 289d
You can run
./nodebb upgradeafternpm installand it will run any migration scripts if they weren't run before../nodebb upgradeis a combination of updating package.json, running npm install and running upgrade scripts.yasas@community.nodebb.org · 1 pts · 288d
Hi baris Brilliant, thanks. I'll do that