enketo-core icon indicating copy to clipboard operation
enketo-core copied to clipboard

Preinstall script is failed in Windows (test command is not recognized as an internal or external command)

Open ediyacoo opened this issue 2 years ago • 4 comments

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

  1. Run npm install in Windows

Expected behavior npm install should be working correctly

Browser and OS (please complete the following information):

  • OS: Windows

ediyacoo avatar Jan 20 '22 21:01 ediyacoo

Having the same issue.

hussain1368 avatar Jul 17 '22 13:07 hussain1368

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.

yixi8524 avatar Oct 10 '22 09:10 yixi8524

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!

lognaturel avatar Oct 11 '22 22:10 lognaturel

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.

yixi8524 avatar Oct 14 '22 07:10 yixi8524