The Tiki 27 plus Build System
As of 2025-03-31, pretty much all the relevant dependencies have been moved to the new build system. For those not yet port, an explanation has been added to vendor_bundled/composer.json
https://gitlab.com/tikiwiki/tiki/-/tree/master/src/js#migrating-dependencies
In Tiki27 a new build system was introduced MR3760 as part of the path rework project. This reduced the code base by 700 000 lines!
This page will describe what you need to know to switch from using previous Tiki versions up to 26.x when installing Tiki using git.
- You need to install node.js
- Then run
sh setup.shand press return to run the build step (which will also run the composervendor_bundledinstall) - If you have a con job running you need to change the command to (something like):
-
cd /home/tiki/master; php8.2 console.php -q vcs:update; sh setup.sh -p php8.2 -k build;
-
Install node.js and npm on Debian12
Log in using ssh as your www tiki user (don't use root)
Use https://nodejs.org/en/download/package-manager
Select the version you need using the dropdown
Install the version as displayed check it is installed
Alternative method of installing Node.js and NPM
If you have root access to the server machine, you can use the following alternative (and cleaner) method. When you can't login as your WWW user, because this isn't enabled in /etc/passwd, you should try this method. This is the case for older Ubuntu distributions, for instance. I have Ubuntu 22.04.4 and the versions of the nodejs and npm packages are old and unsuitable for Tiki 27.
The following method uses the prebuilt binaries of the Node.js distribution. Select the Node.js version. The even numbered versions are stable releases. The odd number versions are development versions. So you'll probably want to use an even number. The version range needed by Tiki 27 is 18 to 21. So you probably want to use version 20. Select "Linux" and "x64". In the following steps, version 20.18.2 is used.
Click on "Download ...". This downloads the tarball node-v20.19.2-linux-x64.tar.xz. Decide on a place of where to install the binaries, go there and unpack it. I'm using /usr/local/lib. This will create the directory node-v20.19.2-linux-x64, which includes everything.
Version used or required by Tiki may change in time. You can check what engines version your Tiki version requires in the package.json file.
"engines": { "npm": ">=9.0.0 <11", "node": ">=18.0.0 <22" },
You need to make the binaries in the bin subdirectory accessible via your PATH, so Tiki's setup.sh script will find them. The problem is, that you need to (or should) use your WWW user to run this script. Like this:
sudo -u www-data sh setup.sh
Bash (and sh) don't load any configuration scripts when called like this (except for a script assigned via the BASH_ENV environment variable, when set). So it isn't easy to add the bin path to your PATH variable. But you can symlink the contents of bin to somewhere in your path. This is where you need root access. For instance, I use /usr/local/bin. Afterwards, the node and npm programs (as well as corepack and npx) will be found:
sudo ln -s /usr/local/lib/node-v20.18.2-linux-x64/bin/* /usr/local/bin
This seems to be the only configuration you need to do for the Node.js prebuilt binaries distribution.
Volker Wysk, 2024-07-09
Troubleshooting
To check which node your user is using which node
To check which npm your user is using which npm
To remove installed packages apt-get purge npm --auto-remove and apt-get purge nodejs --auto-remove
Important URLs
- The main documentation is here -> https://gitlab.com/tikiwiki/tiki/-/tree/master/src/js
- https://gitlab.com/tikiwiki/tiki/-/blob/master/src/js/common-externals/package.json
Examples of moving libs from Composer to the new build system
- https://gitlab.com/tikiwiki/tiki/-/merge_requests/4652
- https://gitlab.com/tikiwiki/tiki/-/merge_requests/4653
- https://gitlab.com/tikiwiki/tiki/-/merge_requests/4602
- https://gitlab.com/tikiwiki/tiki/-/merge_requests/4579