# Error when trying to build storefront

**URL:** https://forum.shopware.com/t/error-when-trying-to-build-storefront/62032
**Category:** Themes & Design
**Created:** [27. September 2019 um 08:28 UTC](https://forum.shopware.com/t/error-when-trying-to-build-storefront/62032 "2019-09-27T08:28:25Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![SorinSologics2019](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@SorinSologics2019](https://forum.shopware.com/u/SorinSologics2019)
#### Post date: [27. September 2019 um 08:28 UTC](https://forum.shopware.com/t/error-when-trying-to-build-storefront/62032/1 "2019-09-27T08:28:25Z")

</div>

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

&nbsp;

---

<div class="post-metadata">

### Author: ![Misengo](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/misengo/32/21446_2.png) [@Misengo](https://forum.shopware.com/u/Misengo)
#### Post date: [21. Januar 2020 um 12:37 UTC](https://forum.shopware.com/t/error-when-trying-to-build-storefront/62032/2 "2020-01-21T12:37:24Z")

</div>

> [@SorinSologics2019 schrieb:](https://forum.shopware.com/profile/32135/SorinSologics2019 "SorinSologics2019")
> 
> 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
> 
> &nbsp;

Did you find the solution for it?&nbsp;

---

<div class="post-metadata">

### Author: ![Adelbert](https://avatars.discourse-cdn.com/v4/letter/a/b782af/32.png) [@Adelbert](https://forum.shopware.com/u/Adelbert)
#### Post date: [11. Februar 2020 um 11:11 UTC](https://forum.shopware.com/t/error-when-trying-to-build-storefront/62032/3 "2020-02-11T11:11:19Z")

</div>

I got the same error. Any solutions?

---

<div class="post-metadata">

### Author: ![Gabryjelski](https://avatars.discourse-cdn.com/v4/letter/g/cab0a1/32.png) [@Gabryjelski](https://forum.shopware.com/u/Gabryjelski)
#### Post date: [11. Februar 2020 um 11:43 UTC](https://forum.shopware.com/t/error-when-trying-to-build-storefront/62032/4 "2020-02-11T11:43:34Z")

</div>

I stumbled across the same error.

It seems&nbsp;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

```

&nbsp;

---

<div class="post-metadata">

### Author: ![MagmaHurricane](https://avatars.discourse-cdn.com/v4/letter/m/5f9b8f/32.png) [@MagmaHurricane](https://forum.shopware.com/u/MagmaHurricane)
#### Post date: [14. Februar 2020 um 04:27 UTC](https://forum.shopware.com/t/error-when-trying-to-build-storefront/62032/5 "2020-02-14T04:27:35Z")

</div>

> Hello,
> 
> We are trying to build storefront using these [myprepaidcenter](https://www.myprepaidcenter.website/) 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.

---

<div class="post-metadata">

### Author: ![SorinSologics2019](https://avatars.discourse-cdn.com/v4/letter/s/c37758/32.png) [@SorinSologics2019](https://forum.shopware.com/u/SorinSologics2019)
#### Post date: [14. Februar 2020 um 07:14 UTC](https://forum.shopware.com/t/error-when-trying-to-build-storefront/62032/6 "2020-02-14T07:14:10Z")

</div>

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

---

<div class="post-metadata">

### Author: ![FloC3](https://avatars.discourse-cdn.com/v4/letter/f/838e76/32.png) [@FloC3](https://forum.shopware.com/u/FloC3)
#### Post date: [24. Februar 2020 um 15:35 UTC](https://forum.shopware.com/t/error-when-trying-to-build-storefront/62032/7 "2020-02-24T15:35:25Z")

</div>

@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?

---

<div class="post-metadata">

### Author: ![WernerBu](https://avatars.discourse-cdn.com/v4/letter/w/71c47a/32.png) [@WernerBu](https://forum.shopware.com/u/WernerBu)
#### Post date: [31. März 2020 um 12:49 UTC](https://forum.shopware.com/t/error-when-trying-to-build-storefront/62032/8 "2020-03-31T12:49:13Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![WernerBu](https://avatars.discourse-cdn.com/v4/letter/w/71c47a/32.png) [@WernerBu](https://forum.shopware.com/u/WernerBu)
#### Post date: [29. April 2020 um 13:32 UTC](https://forum.shopware.com/t/error-when-trying-to-build-storefront/62032/9 "2020-04-29T13:32:51Z")

</div>

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.

&nbsp;
