vuestorefront / shopware-pwa

Shopware PWA for eCommerce. Headless storefront solution for Shopware 6, which communicates through the SalesChannel-API. Always Open Source, MIT license. Made with :blue_heart: by shopware AG & Vue Storefront.
https://frontends.shopware.com
MIT License
345 stars 103 forks source link

npx @shopware-pwa/cli init fails because of Error: file not found nuxt.config.js #1278

Closed josepaiva94 closed 3 years ago

josepaiva94 commented 3 years ago

Describe the bug

When running npx @shopware-pwa/cli init I cannot complete the initialization process because of missing file nuxt.config.js.

Steps to reproduce

✔ Preparing Nuxt project
⠙ Updating configuration for option: canary (current master branch)/~/.npm/_npx/685073/lib/node_modules/@shopware-pwa/cli/node_modules/gluegun/build/index.js:13
    throw up;
    ^

Error: file not found nuxt.config.js
    at ~/.npm/_npx/685073/lib/node_modules/@shopware-pwa/cli/node_modules/gluegun/build/toolbox/patching-tools.js:183:23
    at step (~/.npm/_npx/685073/lib/node_modules/@shopware-pwa/cli/node_modules/gluegun/build/toolbox/patching-tools.js:33:23)
    at Object.next (~/.npm/_npx/685073/lib/node_modules/@shopware-pwa/cli/node_modules/gluegun/build/toolbox/patching-tools.js:14:53)
    at ~/.npm/_npx/685073/lib/node_modules/@shopware-pwa/cli/node_modules/gluegun/build/toolbox/patching-tools.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (~/.npm/_npx/685073/lib/node_modules/@shopware-pwa/cli/node_modules/gluegun/build/toolbox/patching-tools.js:4:12)
    at readFile (~/.npm/_npx/685073/lib/node_modules/@shopware-pwa/cli/node_modules/gluegun/build/toolbox/patching-tools.js:179:12)
    at ~/.npm/_npx/685073/lib/node_modules/@shopware-pwa/cli/node_modules/gluegun/build/toolbox/patching-tools.js:86:46
    at step (~/.npm/_npx/685073/lib/node_modules/@shopware-pwa/cli/node_modules/gluegun/build/toolbox/patching-tools.js:33:23)
    at Object.next (~/.npm/_npx/685073/lib/node_modules/@shopware-pwa/cli/node_modules/gluegun/build/toolbox/patching-tools.js:14:53)

NPM v6.14.8 Yarn v1.22.5 Node v14.15.1 (tried v12.18.4 also)

mkucmus commented 3 years ago

hi @josepaiva94, thanks for reporting!

have you tried to init a project in a completely different (and empty) directory? It may be caused by some files which can collide with the new init.

image

josepaiva94 commented 3 years ago

I only had shopware-pwa.config.js as recommended. It doesn't work with that file.

Tested now without it and it worked for latest stable (recommended) without issues, but for canary

$ npx @shopware-pwa/cli@canary init
✔ Shopware instance address: · http://localhost:8000/
✔ Shopware instance access token: · SWSCUJH4VWTJYXNVSKPPWFO5TQ
✔ Which version you'd like to use: · canary (current master branch)
✔ Preparing Nuxt project
✔ Updating configuration for option: canary (current master branch)
✔ Generating project files
Please provide username and password for plugins authentication. You can leave the fields empty if connecting to demo instance or if you don't need plugins :)
✔ Shopware admin username: · admin
✔ Shopware admin password: · ********
✔ Do you want to allow dev mode for slots? (Don't use for production!) (y/N) · false
UNEXPECTED ERROR [object Object]
✔ Generating plugins files
Shopware languages refreshed
Plugins generated
CMS prepared
Shopware languages refreshed
✔ Updating dependencies
Generated Shopware PWA project!
Type 'shopware-pwa dev' and start exploring

I know that's not a real problem as canary is to use at our own risk.

Thanks!