Search code examples
orocommerce

When installing cms-form-builder composer fails with Failed to generate package-lock.json


I'm new to Orocommerce, symfony, and composer.
I just installing a clean version of Orocommerce (AWS image) and trying to install cms-form-builder using composer.

when I run php bin/composer require b2bcodext/cms-form-builder

I get the following error.

Updating the "config/parameters.yml" file
> Oro\Bundle\InstallerBundle\Composer\ScriptHandler::setPermissions
> Oro\Bundle\InstallerBundle\Composer\ScriptHandler::updateAssets
npm install --no-audit --save-exact --no-optional --loglevel error
sh: line 0: exec: npm: not found
Script Oro\Bundle\InstallerBundle\Composer\ScriptHandler::updateAssets handling the update-assets event terminated with an exception
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
In ScriptHandler.php line 149:
  Failed to generate package-lock.json

Not sure what this means - any help would be greatly appreciated.


Solution

  • npm: not found

    It says, the application cannot find NPM to install JavaScript dependencies.

    If you haven't installed NPM yet, just follow the official guide to do that: https://www.npmjs.com/get-npm

    Alternatively, if it's already installed, but the application doesn't know where it is, you can provide the path to the NPM explicitly with the application configuration option: https://doc.oroinc.com/backend/bundles/platform/AssetBundle/#configuration