embedded-app-sdk
embedded-app-sdk copied to clipboard
[Fix] react-colyseus - Windows crash
Environment variables are referenced differently depending on the operating system.
On Unix-like operating systems such as macOS and Linux, they are referenced using a dollar sign ($) prefix. For example:
$npm_execpath
^
On Windows, they are referenced using a percent sign (%) on both sides. For example:
%npm_execpath%
^ ^
The solution applied involves accommodating this difference in referencing environment variables between Unix-like systems and Windows.
Original:
"dev": "nodemon --watch src -e ts,ejs --exec $npm_execpath start",
Updated:
"dev": "nodemon --watch src -e ts,ejs --exec $npm_execpath start",
"dev:win": "nodemon --watch src -e ts,ejs --exec %npm_execpath% start",
In the updated version, a separate script dev:win
is added to cater to Windows systems, where %npm_execpath%
is used to reference the environment variable instead of $npm_execpath
. This ensures compatibility across different operating systems.