Open fahadjabbar8 opened 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.
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.
@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.
@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?
Created in Jira backlog
@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.
Closing this as a bug per Tommy's comment, Window's support currently doesn't exist for scaffolding.
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.
Thanks for the input @jissereitsma! We would welcome a contribution (from anyone 😄) that:
create-pwa/util
.is-invalid-path
dependency from the create-pwa/package.json.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.
@magento export issue to JIRA project PWA as Bug
:white_check_mark: Jira issue https://jira.corp.magento.com/browse/PWA-1726 is successfully created for this GitHub issue.
@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.
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 :)
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.
@sirugh I want to contribute to this issue.
+1
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.
Still the same issue happening even in Jan 2024, when running scaffold related command for yarn.
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
The issue still persist on Window as of May 13, 2024. Any solution to that issue?
To address the issue of yarn create @magento/pwa
getting stuck at the first question on Windows, you can follow these steps:
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
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
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.
Clear Yarn Cache: Clearing the Yarn cache can sometimes resolve issues with stuck processes.
yarn cache clean
Use npx Instead of Yarn:
Sometimes, using npx
instead of yarn create
can bypass certain issues.
npx @magento/create-pwa
Run in a Different Shell: Try running the command in a different shell (like Git Bash or PowerShell) to see if the issue persists.
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.
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
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.
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.
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:
Expected behavior Should run to next question as it is a valid path.Something other is happening
Screenshots
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:
create-pwa/util
.is-invalid-path
dependency from the create-pwa/package.json.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.