infinum / eightshift-frontend-libs

Frontend library that exposes custom scripts and styles for modern WordPress projects
https://eightshift.com
MIT License
71 stars 12 forks source link

[BUG] Setup fails on Windows (wamp) #526

Closed rtomicic closed 2 years ago

rtomicic commented 3 years ago

Describe the bug

The script fails at 4th step with composer - the lock file exists in the folder yet it is not recognized so the installation fails.

Steps to Reproduce

  1. instal: node v14.15.4, Composer version 2.0.8, WP-CLI version: 2.4.0, git version 2.30.0.windows.2
  2. To reproduce start the standard installation process from quickstart ( npx create-wp-project )
  3. The script fails

Expected behavior

script to pass the 4th step and offer the finishing steps

Screenshots

error msg

Your Environment

Additional context

dingo-d commented 3 years ago

Hi!

This could be due to the PHP version. IIRC we are supporting only PHP 7.2 onwards, and you mentioned that your CLI is on 5.6.4, which is why the installation fails.

iruzevic commented 3 years ago

Also we haven't tested it on Win env.

rtomicic commented 3 years ago

Thanks for the reply, I will try PHP version 7.3 and find out if it works in windows.

iruzevic commented 3 years ago

@rtomicic have you tested this on PHP 7.3 ? is it working?

simun-ivanac commented 3 years ago

Maybe I can jump in with some info!

I managed to pass this part with XAMPP in Windows and setup the project successfully:

So this is WAMP's thing, PHP's... or some other issue occured, but it's not Windows problem.

But theme can't be used in Windows anyway. When you run wp boilerplate setup_theme you'll get an error. That's mostly because of WP-CLI. WP-CLI uses unix commands for its operations which Windows doesn't recognize and throws errors. That's why on official WP-CLI documentation under Installing is said:

UNIX-like environment; limited support in Windows environment

You can bypass some things using Git Bash (or some other tool), but that's not the solution. Everything related to directory paths and terminal commands that WP-CLI is in charge will most likely end up with errors. I tried to fix some errors in exact files where they occured and it worked partially. But everything was related to Cli files. I think that proves it's actually WP-CLI's thing, not necessarily theme's.

Because of that, I would strongly recommend to use it in Linux or MacOS. It's not compatible with Windows. If someone doesn't want to switch to different OS completely, the best solution is to install Linux in VirtualBox. It's quite simple thing to do.

I hope I helped a little! These were just my conclusions. If I missed out something, feel free to ask :smiley:

dingo-d commented 3 years ago

Or you can use WSL2 on Windows, works for me 😄

simun-ivanac commented 3 years ago

Or that too :smiley:

iruzevic commented 2 years ago

fixed