Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property '@babel/cli' of undefined #667

Open
thompalstra opened this issue Dec 14, 2023 · 0 comments
Open

Cannot read property '@babel/cli' of undefined #667

thompalstra opened this issue Dec 14, 2023 · 0 comments

Comments

@thompalstra
Copy link

thompalstra commented Dec 14, 2023

Installation of the MolliePayments plugin, either via de Shopware Store or Composer will always result in an error when running bin/build-storefront or bin/build-administration.sh due to the node_modules folder not being created during the build.

This seems to be caused by the non-standard webpack configuration used in the MolliePayments plugin.

As an example I've looked at another plugin called MoorlFoundation which also uses npm dependencies and this plugin seems to install it's own dependencies just fine when running build.

Below is a working example taken from MoorlFoundation:

MoorlFoundation/src/Resources/app/storefront/build/webpack.config,js

// eslint-disable-next-line func-names
module.exports = function (params) {
    return {
        resolve: {
            modules: [
                `${params.basePath}Resources/app/storefront/node_modules/`,
                `${params.basePath}Resources/app/administration/node_modules/`
            ],
            alias: {
                MoorlFoundation: `${params.basePath}Resources/app/storefront/src/`,
            }
        }
    };
};

MoorlFoundation/src/Resources/app/storefront/package.json

{
  "dependencies": {
    "dropzone": "6.0.0-beta.2",
    "leaflet": "^1.8.0",
    "papaparse": "^5.3.2",
    "signature_pad": "^4.0.5",
    "vuedraggable": "^2.24.3"
  }
}

This is of course an over-simplification because the MolliePayments plugin has much more dependencies. However implementing the above will result in your plugin working out-of-the-box without the need for manual npm install commands to be ran.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant