Why Mautic 7.2.2 Composer Install Fails and How to Fix Missing Node Modules

If you’re trying to install Mautic version 7.2.2 and running into errors like your site going offline after the install, or missing CSS and JS files in the var/sass and node_modules directories, you’re not alone. A recent thread on the Mautic community forum highlights these issues where users find composer installs incomplete, specifically the dreaded missing node_modules folder that’s supposed to hold essential frontend dependencies like jQuery and Mousetrap.

The root cause here boils down to changes in the Mautic 7.2.2 installation process which no longer bundles or builds frontend assets the way users expect. Running php bin/console sass:build throws errors, and manually copying folders like var/sass can only get you so far because the node_modules folder isn’t part of the zip download or composer install at all. You end up stuck with 504 Gateway Timeout errors or Twig template rendering errors complaining about missing JS files.

Unfortunately, this appears to be a packaging issue in 7.2.2. The official Mautic GitHub doesn’t yet have a clear fix or open issue specifically addressing this missing node_modules problem for 7.2.2, but the community has pointed out a crucial workaround: you need to run npm install in your Mautic directory to generate that missing folder before running build commands. Without the node_modules directory, the build process that compiles your CSS and JS can’t complete, which is why you see so many errors post-install.

This means that on your server, besides PHP and composer, you must have Node.js and npm installed to properly setup these frontend assets. It’s a bit of a hassle if you’re used to a pure PHP approach, but unavoidable if you want a fully functional Mautic install from 7.2.2 onwards.

From a practical standpoint, if you’re not comfortable running npm or managing Node dependencies, it’s worth considering a fully hosted Mautic platform like Mailertizer. We handle all this build and dependency stuff behind the scenes, so you get a smooth installation and reliable updates without digging into the weeds of asset compilation.

The upshot: If you hit this error on 7.2.2, don’t just fiddle with composer or zip copies alone. Check your server environment, install Node.js/npm if needed, run npm install, then php bin/console sass:build. That should put you back on track with all CSS and JS assets in place.

For the full discussion and ongoing solutions, check out the original Mautic community thread here. And if you want to skip these headaches entirely, Mailertizer’s hosted Mautic takes care of all this technical setup so you can focus on marketing, not builds.

Share the Post: