Created by: anuraaga
Instead of requiring Node to be on the system PATH.
Currently, react-scripts
spawns scripts such as test
, build
by specifying an executable name, node
. This requires node
to be on the system PATH. Some users (like me) may not have it on the system PATH and normally don't have problems since an IDE like Webstorm configured with a node interpreter mostly runs tests and builds without any problem. However, this doesn't work with create-react-app
because it expects node
on the PATH.
Luckily, there is an easy way of getting an absolute path to the current interpreter binary so we can use it and remove the requirement that node
is on the system PATH.
I have verified that before this change, running tests in Webstorm failed with this
'node' is not recognized as an internal or external command,
operable program or batch file.
while after the change, tests run.
I ran yarn run format
which pulled in an unrelated file. Hope it's ok to update it so people don't keep on running into it when sending a change.