Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 task
fahadjabbar8 opened this issue Apr 18, 2020 · 23 comments
Open
1 task
Labels
bug Something isn't working Progress: ready for dev

Comments

@fahadjabbar8
Copy link

fahadjabbar8 commented Apr 18, 2020

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)

  • Device PC
  • OS Windows 10
  • NPM version :6.4.1
  • yarn version :1.16.0
  • Node Version : 10.15.3
    -Python : 3.8.2

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

  • create-pwa

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 fahadjabbar8 added the bug Something isn't working label Apr 18, 2020
@fahadjabbar8
Copy link
Author

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.

@fahadjabbar8 fahadjabbar8 changed the title [bug]: yarn create @magento/pwa stuck at first question [bug]: yarn create @magento/pwa stuck at first question on Windows Apr 19, 2020
@Jordaneisenburger
Copy link
Member

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
Copy link
Author

@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
Copy link
Contributor

@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
Copy link

Created in Jira backlog

@fahadjabbar8
Copy link
Author

@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
Copy link

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

@jissereitsma
Copy link
Contributor

To further document this issue, it seems that this bug is related to the following issue: jonschlinkert/is-invalid-path#2 A PR to fix this has been created as well jonschlinkert/is-invalid-path#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
Copy link
Contributor

sirugh commented May 12, 2021

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 sirugh reopened this May 12, 2021
@sirugh
Copy link
Contributor

sirugh commented May 12, 2021

@magento export issue to JIRA project PWA as Bug

@github-jira-sync-bot
Copy link

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

@jissereitsma
Copy link
Contributor

@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
Copy link
Contributor

sirugh commented May 17, 2021

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
Copy link
Contributor

sirugh commented May 18, 2021

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
Copy link

@sirugh I want to contribute to this issue.

@shamseerahammedm
Copy link

+1

@huanth
Copy link

huanth commented Nov 23, 2021

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
Copy link

  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
Copy link

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

@bastianhilton
Copy link

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
Copy link

Chypro commented May 13, 2024

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

@DeepShah2511
Copy link

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Progress: ready for dev
Projects
None yet
Development

No branches or pull requests