Your software
My Mautic version is: 5.1.0
My PHP version is: 8.1
My Database type and version is: MariaDB
Your problem
My problem is: I’m trying to install Mautic 5 via composer using this guide, I do not follow all the commands because some are outdated but I basically have the same flow. Everything goes smoothly until I get to the part where I have to install Nodejs and NPM, I install both using the steps from the official website with the following commands:
# installs nvm (Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
# download and install Node.js (you may need to restart the terminal)
nvm install 18
# verifies the right Node.js version is in the environment
node -v # should print `v18.20.4`
# verifies the right npm version is in the environment
npm -v # should print `10.7.0`
That installs nicely nicely, I then proceed to install composer and finally mautic:
cd /var/www/html
sudo COMPOSER_ALLOW_SUPERUSER=1 composer create-project mautic/recommended-project:^5.0 mautic --no-interaction
And that’s where I get the following error at the end of the installation script process:
> npm ci --prefer-offline --no-audit
sh: 1: npm: not found
Script npm ci --prefer-offline --no-audit handling the npm-ci event returned with error code 127
Script @npm-ci was called via post-update-cmd
So I went ahead and installed NPM with ‘apt install npm’ command, hoping that fixes the problem. But no dice, apart from that error code above, I now get the following error as well, as if installing npm from the default repo downgrades my nodejs:
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: 'postcss-normalize-display-values@6.0.2',
npm WARN EBADENGINE required: { node: '^14 || ^16 || >=18.0' },
npm WARN EBADENGINE current: { node: 'v12.22.9', npm: '8.5.1' }
npm WARN EBADENGINE }
These errors are showing in the log: Showed in the above process.
Like why does it say I have an unsupported engine when node -v and npm -v checks out and different than what that error report says?
Steps I have tried to fix the problem: Showed in the above process as well.