Error when trying to build storefront

Hello,

We are trying to build storefront using these commands:

php bin/console bundle:dump
PROJECT_ROOT= __ABSOLUTE_PATH_TO_PROJECT_ROOT__ / npm --prefix vendor/shopware/storefront/Resources/ run production
php bin/console theme:compile
php bin/console assets:install

But we get this error even if we install the module (npm install app-module-path --save);

Error: Cannot find module 'app-module-path'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:690:17)

Does anyone have an ideea how we can solve this?

Thank you in advance.

Best regards,

Sorin

 

@SorinSologics2019 schrieb:

Hello,

We are trying to build storefront using these commands:

php bin/console bundle:dump
PROJECT_ROOT= ABSOLUTE_PATH_TO_PROJECT_ROOT / npm --prefix vendor/shopware/storefront/Resources/ run production
php bin/console theme:compile
php bin/console assets:install

But we get this error even if we install the module (npm install app-module-path --save);

Error: Cannot find module ‚app-module-path‘
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)

Does anyone have an ideea how we can solve this?

Thank you in advance.

Best regards,

Sorin

 

Did you find the solution for it? 

I got the same error. Any solutions?

I stumbled across the same error.

It seems that the storefront depends on some libs, which are included in the admistration parts.

So you need to build the administration first

bin/build-administration.sh

before building the storefront

bin/build-storefront.sh

 

1 Like

Hello,

We are trying to build storefront using these myprepaidcenter commands:

php bin/console bundle:dump
PROJECT_ROOT= ABSOLUTE_PATH_TO_PROJECT_ROOT / npm --prefix vendor/shopware/storefront/Resources/ run production
php bin/console theme:compile
php bin/console assets:install

But we get this error even if we install the module (npm install app-module-path --save);

Error: Cannot find module ‘app-module-path’
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)

Does anyone have an ideea how we can solve this?

Thank you in advance.

Facing the same problem, please help me.

Hello.

You should use the psh commands like ./psh.phar administration:build and storefront:build.

But before running these you need to run administration:init and storefront:init

Regards,

Sorin

@SorinSologics2019‍

but this ./psh.phar commands only run in develop mode, doesn’t they?

what about if I want to build my storefront in production mode?

Hi,

not bad, it seems that

 bin/console theme:compile

now works with the production version of Shopware, i.e. with install_6.1.4_1584369563.

In my plugin i can use Sass-Files to change the Theme, thanks.

(… or was that more of a coincidence and Shopware doesn’t even want it…)

I also think that this should be possible in any case, also in the future, not that Shopware will change anything there again. I would not like to use the development version. I want to develop with the same version that is live.

Best regards,

Werner.

Hi,

bin/console theme:compile doesn’t only compile the scss-File’s.

Is it possible to compile the Javascript-Plugin’s, that is the extension of the Shopware 6 Plugin class.

I’m using the production environment.

Thanks and best regards,

Werner.