Closed oltionchampari closed 3 years ago
@oltionchampari Thanks for the fix. I tried that new preinstall command with my PowerShell on Windows 10 (with 20H2) and got the following error (in German):
In Zeile:1 Zeichen:39 + rimraf node_modules package-lock.json || exit 0 + ~~ Das Token "||" ist in dieser Version kein gültiges Anweisungstrennzeichen. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : InvalidEndOfLine
Researching the error, I've found that the pipeline operators
||
and&&
have been introduced with PowerShell v7.0.0 (see PowerShell/PowerShell#9849). Hence, they will only work with the most recent PowerShell version.@anita-steiner We need to decide if Windows users require the newest PowerShell or we change the preinstall command.
I will check the version: the version is 5.1.17763.1490
Btw there are a lot of still other scripts that use the pipeline operators (&&
and ||
; see https://github.com/phovea/generator-phovea/pull/447). We might need to change it as well (depending on the PowerShell version).
so we need a solution for ps version >= 5.1
Closes phovea/generator-phovea#404
Developer Checklist (Definition of Done)
release: minor
) to this PR following semverSummary of changes
rimraf node_modules
in windows you get a warning since the package deletes itself. We could solve this if we are prepared to installrimraf
globally.|| true
(throws an error in windows) with|| exit 0
which works for both windows and linux.Notes
Another windows incompatible script is:
"build:python": "rm -rf build/source && find . -name '*.pyc' -delete && node buildPython.js && cp -r ./<%-name.toLowerCase()%> build/source/",
Both therm -rf
andcp
do not exist in windows. I do not know though if this needs to be windows compatible though.