enketo-core
enketo-core copied to clipboard
Preinstall script is failed in Windows (test command is not recognized as an internal or external command)
Describe the bug
The preinstall
script is failed in Windows as the test
is not recognized as an internal or external command.
https://github.com/enketo/enketo-core/blob/face801ec6f2e453f8eb6d19b9e646015c15eba3/package.json#L44
To Reproduce
- Run
npm install
in Windows
Expected behavior
npm install
should be working correctly
Browser and OS (please complete the following information):
- OS: Windows
Having the same issue.
The same issue https://github.com/enketo/enketo-core/issues/912 created by @hussain1368
Options 1: This preinstall script needs to run on both Linux and Windows platforms. Is possible to use a node script instead current bash file?
Options 2:
test -f ./node_modules && ./scripts/preinstall || true test -f ./node_modules && ./scripts/preinstall || (exit 0)
Use || (exit 0)
instead of the || true
also can work with Windows, but the preinstall will never run in Windows env.
Can you please describe what you're trying to do in more detail? Are you trying to run stock Enketo in a Windows environment or are you developing against it? Are you developing to make contributions to the core or in your private fork?
Is possible to use a node script instead current bash file?
Consider opening a pull request for further discussion!
Can you please describe what you're trying to do in more detail? Are you trying to run stock Enketo in a Windows environment or are you developing against it?
The enketo-core is our web app dependence, current preinstall script will cause our npm ci to fail in Windows env. We have a temporary fix. Because we don't need the preinstall script in the package.json. We directly remove this preinstall script in our archive enketo-core.
Are you developing to make contributions to the core or in your private fork?
We have an archive version of enketo-core to fix this issue. But will be happy to see this fix installed on the enketo-core repo. Let us can use the release version instead our current archive one.