magento / pwa-studio

🛠Development tools to build, optimize and deploy Progressive Web Applications for Magento 2.
https://developer.adobe.com/commerce/pwa-studio/
Open Software License 3.0
1.06k stars 682 forks source link

[bug]: yarn create @magento/pwa stuck at first question on Windows #2342

Open fahadjabbar8 opened 4 years ago

fahadjabbar8 commented 4 years ago

Describe the bug When i am trying to use the cli command yarn create @magento/pwa its is stuck in the first question and giving error for almost any string address i provide Invalid directory path; contains illegal characters.

To reproduce Steps to reproduce the behavior:

  1. Go to windows PC install all dependencies mentioned latest python, node , yarn
  2. Now to setup this project move a sample directory i tried D:\Projects
  3. Run yarn create @magento/pwa
  4. After Installing create-pwa 1.0 with binaries it is stuck at first question for any thing i type as directory
  5. I tries test , ../test , anything it is keep on giving the error Invalid directory path; contains illegal characters

Expected behavior Should run to next question as it is a valid path.Something other is happening

Screenshots Screenshot (28) Screenshot (29) Screenshot (30)

Please let us know what packages this bug is in regards to:

Guidance

Copied from my comment below:

Thanks for the input @jissereitsma! We would welcome a contribution (from anyone 😄) that:

Doing the above will at least remedy the issue which @jissereitsma noted may prevent at least this line from executing in Windows. That said, I'm not sure if the app will function even if you get it to scaffold. Still, we should avoid non-maintained dependencies so I think this is a good idea.

fahadjabbar8 commented 4 years ago

I have gone through your package code and identified the issue is with this package is-invalid-path at line number 31 in create-pwa index file where its being used for validating path apparently this package is suppose to validate only windows path as per package documentation but as ironic as it seems it might be failing for windows only :)

For now updating the local cli code to generate the project but would love to see you guys use some different package for it since its failing in first question for windows platform.

Jordaneisenburger commented 4 years ago

Might not be the reason you setup is failing but you don't really wanna develop your project on windows directly. I'd suggest trying the docker setup, saves you a lot of headaches in the long run.

fahadjabbar8 commented 4 years ago

@Jordaneisenburger Are you referring the complete source code one having all packages locally or is there an independent setup using yarn create @magento\pwa with a docker configuration file i would be interested in the second one.

tjwiebell commented 4 years ago

@fahadjabbar8 - Our docker setup is in the monorepo, and is not distributed or supported in a scaffolded app (yarn create @magento/pwa). The docker files are hard-coded to monorepo paths, but could easily be used as a template on how to roll your own.

I would suggest using the Linux sub-system if available, otherwise Docker would be your next best bet. We'll still review this in our grooming, but Windows support has been low on the priority list. If we helped identify areas that needed to be made Windows compatible, would you be interested in contributing those changes to the repo?

awilcoxa commented 4 years ago

Created in Jira backlog

fahadjabbar8 commented 4 years ago

@tjwiebell We have decided to go with vagrant since its failing on next steps and even to build the project as well. This issue is an easy fix and i would love to do that but the issues after that need some more time to think through. With current support of pwa-studio for windows its really hard to work with windows environment. The easiest solution could be docker support for scaffolded app i.e for yarn create @magento\pwa since a lot of people including us start by cloning the whole cli and core pwa-studio hence starting the setup with a wrong first step.

I would love you guys to put scaffolded app docs in the getting started phase and if you could provide the dedicated pwa-studio slack channel that would be cool.

awilcoxa commented 4 years ago

Closing this as a bug per Tommy's comment, Window's support currently doesn't exist for scaffolding.

jissereitsma commented 3 years ago

To further document this issue, it seems that this bug is related to the following issue: https://github.com/jonschlinkert/is-invalid-path/issues/2 A PR to fix this has been created as well https://github.com/jonschlinkert/is-invalid-path/pull/3 but it seems as if the creator is no longer maintaining this package.

My recommendation would be to abandon the usage of this package alltogether and simply copy the lines of the original package (plus the PR) into the codebase here. Or fork the original repo.

sirugh commented 3 years ago

Thanks for the input @jissereitsma! We would welcome a contribution (from anyone 😄) that:

Doing the above will at least remedy the issue which @jissereitsma noted may prevent at least this line from executing in Windows. That said, I'm not sure if the app will function even if you get it to scaffold. Still, we should avoid non-maintained dependencies so I think this is a good idea.

sirugh commented 3 years ago

@magento export issue to JIRA project PWA as Bug

github-jira-sync-bot commented 3 years ago

:white_check_mark: Jira issue https://jira.corp.magento.com/browse/PWA-1726 is successfully created for this GitHub issue.

jissereitsma commented 3 years ago

@sirugh I wanted to confirm as a step one whether this would be a smart idea. A bummer is that I don't have a Windows machine to test this on. First 3 steps don't require much, except for minor stuff.

sirugh commented 3 years ago

I wanted to confirm as a step one whether this would be a smart idea. A bummer is that I don't have a Windows machine to test this on. First 3 steps don't require much, except for minor stuff.

@jissereitsma the issue you noted is relevant - the dependency is outdated. So regardless of whether the rest of the app actually functions on Windows, we will at least have to do this first step, after which we can open further bugs/issues if Windows support is desired. I will note that in the past our PM has stated that this is not something we will support right now, but if community folks wanted to help out here we would certainly be open to it :)

sirugh commented 3 years ago

As per https://magento.github.io/pwa-studio/frequently-asked-questions/ we're not supporting Windows development necessarily, but if someone from community wants to do this work (as detailed by my above comment) we're open to accepting it.

Until then this will sit in "ready for dev" or eventually be closed as stale.

guilhermeamadowj commented 3 years ago

@sirugh I want to contribute to this issue.

shamseerahammedm commented 3 years ago

+1

huanth commented 2 years ago

Hello, I have read the user manual but still do not know how to do the above steps, please explain more or have a video tutorial to help me, I really need it and don't have a solution.

DeepShah2511 commented 1 year ago
  1. Go to windows PC install all dependencies mentioned latest python, node , yarn
  2. Now to setup this project move a sample directory i tried D:\Projects
  3. Run yarn create @magento/pwa
  4. it will stops from create project root directory error-while-creating-pwa-studio-setup-in-local-windows
balanandula commented 7 months ago

Still the same issue happening even in Jan 2024, when running scaffold related command for yarn.

image
bastianhilton commented 7 months ago

same issue in Jan 2024, its ridiculous that even in 2024 developers will completely disregard an entire OS especially one as popular and mainstream as Windows. If this doesn't work on Windows then something on the Adobe site for the PWA should mention that

Chypro commented 4 months ago

The issue still persist on Window as of May 13, 2024. Any solution to that issue?

DeepShah2511 commented 3 months ago

To address the issue of yarn create @magento/pwa getting stuck at the first question on Windows, you can follow these steps:

  1. Check Node.js and Yarn Versions: Ensure that you have the latest versions of Node.js and Yarn installed. Sometimes, outdated versions can cause compatibility issues.

    node -v
    yarn -v

    Update Node.js from the official site if needed. For Yarn, you can update it using the following command:

    npm install -g yarn
  2. Run Command with Debug Logging: Running the command with debug logging can provide more insights into where it is getting stuck.

    yarn create @magento/pwa --verbose
  3. Check for Existing Issues: Review existing issues on the Magento PWA GitHub repository to see if others have encountered the same problem and if a solution has been posted.

    Magento PWA GitHub Issues

  4. Clear Yarn Cache: Clearing the Yarn cache can sometimes resolve issues with stuck processes.

    yarn cache clean
  5. Use npx Instead of Yarn: Sometimes, using npx instead of yarn create can bypass certain issues.

    npx @magento/create-pwa
  6. Run in a Different Shell: Try running the command in a different shell (like Git Bash or PowerShell) to see if the issue persists.

  7. Check System Permissions: Ensure that you have the necessary permissions to run the command and that there are no restrictions imposed by your system or antivirus software.

  8. Temporary Directory Issues: Sometimes the issue could be related to the temporary directory that Yarn uses. You can try changing the temporary directory by setting the TMPDIR environment variable:

    set TMPDIR=C:\path\to\new\tmpdir
    yarn create @magento/pwa
  9. Manual Installation: As a last resort, you can manually set up the Magento PWA by cloning the repository and following the setup instructions.

    git clone https://github.com/magento/pwa-studio.git
    cd pwa-studio
    yarn install

    Follow the manual setup guide provided in the repository's documentation.

If none of these steps resolve the issue, you can provide more details such as the exact versions of Node.js and Yarn you're using, any error messages that appear, and your operating system details. This information can help in diagnosing the problem further.

OliverRC commented 1 month ago

It is quite a failing on Adobe's part to have a node based tool not support Windows. I do loads of node / javascript development and this is the first scaffolding tool that has this issue.

Some days I really question Adobe and the Magento 2 technologies. Everything is made unnecessarily difficult and issues don't seem to get resolved.

Something like PWA Studio should have no reason being crossplatform. Why alieanate a large community of developers.

I am as luke warm on Windows as the next person but think it's some moral high-ground to prevent Windows developers using your tools is just braindead.