vuestorefront / vue-storefront

Alokai is a Frontend as a Service solution that simplifies composable commerce. It connects all the technologies needed to build and deploy fast & scalable ecommerce frontends. It guides merchants to deliver exceptional customer experiences quickly and easily.
https://www.alokai.com
MIT License
10.64k stars 2.08k forks source link

[Bug]: CLI init for Magento integration (manual install) fails (Windows+WSL) #6919

Closed DavidDeSloovere closed 1 year ago

DavidDeSloovere commented 1 year ago

Describe the Bug

Once again it's not possible to create a project using the CLI.

Throws error when trying to delete .env.example

Current behavior

    Error: ENOENT: no such file or directory, rmdir 'D:\Temp\vsfmag\whyfail\.env.example'
    Code: ENOENT

The file exists, but it's not a directory. rmdirSync is used, which might be the reason it fails? Shoud it be unlinkSync

https://github.com/vuestorefront/vue-storefront/blob/4e1ff1aea26493574db860b845128a0ec042b448/packages/cli/src/domains/magento2/functions/copyEnv.ts#L34

Expected behavior

No errors.

Steps to reproduce

On Windows or WSL:

npx @vue-storefront/cli@latest init using Magento 2 and No auto installation

image

What version of Vue Storefront are you using?

-

What version of Node.js are you using?

16.20

What browser (and version) are you using?

-

What operating system (and version) are you using?

Windows / WSL

Relevant log output

Error: ENOENT: no such file or directory, rmdir 'D:\Temp\vsfmag\whyfail\.env.example'
    Code: ENOENT

Able to fix / change the documentation?

Code of Conduct

skirianov commented 1 year ago

looking into it

skirianov commented 1 year ago

can you try to run npx @vue-storefront/cli@4.2.2-rc.1 init ?

I just published release candidate package

skirianov commented 1 year ago

this should fix it #6924

DavidDeSloovere commented 1 year ago

👍 Fixed for WSL On Win another bug surfaces, but this one looks fixed.