Closed curtisdelicata closed 4 years ago
I got the build script for yarn build to work using this on Windows:
"scripts": {
"serve": "npx run-script-os",
"serve:default": "vue-cli-service serve",
"serve:windows": "node_modules\\.bin\\vue-cli-service serve",
"build": "npx run-script-os",
"build:default": "rm -rf ..\\/public/{js,themes,themes-rtl,images} && vue-cli-service build --no-clean --modern",
"build:windows": "cd ..\/public && rd \/s \/q js & rd \/s \/q themes & rd \/s \/q themes-rtl & rd \/s \/q images & cd ..\/client && node_modules\\.bin\\vue-cli-service lint & node_modules\\.bin\\vue-cli-service build --no-clean --modern --skip-plugins thread-loader",
"dev": "npx run-script-os",
"dev:default": "rm -rf ../public/{js,themes,themes-rtl,images} && vue-cli-service build --no-clean --mode development",
"dev:windows": "cd ..\/public && rd \/s \/q js & rd \/s \/q themes & rd \/s \/q themes-rtl & rd \/s \/q images & cd ..\/client && node_modules\\.bin\\vue-cli-service lint & node_modules\\.bin\\vue-cli-service build --no-clean --mode development --skip-plugins thread-loader",
"lint": "npx run-script-os",
"lint:default": "vue-cli-service lint",
"lint:windows": "node_modules\\.bin\\vue-cli-service lint",
"postinstall": "opencollective-postinstall && patch-package",
"prod": "npm run build"
},
Full working changes can be seen at https://github.com/modularsoftware/genealogy/blob/master/client/package.json
@curtisdelicata has it been solved?
It could be closed if you don't want it included but it might be useful for you so others can be building on Windows.
This is a bug and feature request.
Prerequisites
Description
composer can be fixed using:
under config part of the file which was working on some tests but when it didn't running composer install --ignore-platform-reqs always worked.
bulma-rtl.patch can be fixed by deleting the trailing line at the end and saving again. I couldn't commit so renamed after then renamed back. Tested on my Ubuntu server and the patch still applies. This fixes yarn install.
yarn build can be fixed by running different commands based on operating system using npx run-script-os. I developed this set of commands: "build": "npx-run-script-os", "build:default": "rm -rf ..\/public/{js,themes,themes-rtl,images} && vue-cli-service build --no-clean --modern", "build:windows": "cd ..\public && if exist js rd \/s \/q js && if exist themes rd \/s \/q themes && if exist themes-rtl rd \/s \/q themes-rtl && if exist images rd \/s \/q images && cd client & node_modules\.bin\eslint --fix & node_modules\.bin\vue-cli-service build --no-clean --modern --skip-plugins thread-loader", "dev": "npx-run-script-os", "dev:default": "rm -rf ../public/{js,themes,themes-rtl,images} && vue-cli-service build --no-clean --mode development", "dev:windows": "cd ..\public && if exist js rd \/s \/q js && if exist themes rd \/s \/q themes && if exist themes-rtl rd \/s \/q themes-rtl && if exist images rd \/s \/q images && cd client & node_modules\.bin\eslint --fix & node_modules\.bin\vue-cli-service build --no-clean --mode development --skip-plugins thread-loader",
Now the install steps should work on Windows hosts as soon as I manage to debug why it it is not continuing along the commands running in Windows. Anyone know why it it isn't running the next command in the list?
Steps to Reproduce
composer install fails because of pcntl or posix yarn install fails because of line ending on the bulma-rtl patch but other patches were fine yarn build fails as it relies on Linux style commands such as rm
Expected behavior
I expected it to fail as not been designed for Windows.
Actual behavior
It did not work.