Updating to Directus 11.4.X
For those who are self-hosted, updating to version 11.4.x is a significant change because it requires NodeJS v22. This articles covers the simple steps to update Directus and NodeJS at the same time.
Update NodeJS to v22 first then take Directus offline. Delete the node_modules folder and package_lock.json file from inside the Directus project's folder, then run npm install [email protected]
. Lastly start Directus.
Here are the steps in more detail:
Step 1: Update NodeJS
There are many different ways to install NodeJS so Google is your friend. For me, I'm using CentOS 8 and dnf.
dnf module reset nodejs
dnf module enable nodejs:22
dnf install nodejs
node -v
For other platforms please see the official documentation:
Step 2: Prepare Directus
Stop the Directus service and remove the node_modules folder and the package-lock.json file from the Directus project folder. These need to be deleted to ensure all dependancies are compiled used Node 22 and also the package_lock to allow new versions of the dependancies to be used.
rm -rf node_modules package-lock.json
Update any SQL libraries in package.json to ensure they support node v22 by editing the file and updating the version number. For my project, mssql was very out of date so I changed it to 11.0.1 (latest at the time). This is also relevant for mysql2, postgres and sqlite.
Step 3: Install Directus 11.4.X
While in the Directus Project folder, run the following command:
npm install [email protected]
This will install the new version of Directus and compile all the dependancies using node 22. This is a good opportunity to grab a coffee as it can take a few minutes to complete.
Update the database schema:
npx directus database migrate:latest
Lastly, start Directus.
Conclusion
To update Directus to v11.4.X, NodeJS must be updated to v22. With these 3 easy steps we have updated NodeJS, prepared the Directus project folder and Installed the new version. You can now enjoy v11.4.X and beyond.