embedded-app-sdk icon indicating copy to clipboard operation
embedded-app-sdk copied to clipboard

[Fix] react-colyseus - Windows crash

Open 1ly4s0 opened this issue 11 months ago • 1 comments

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.

1ly4s0 avatar Mar 22 '24 19:03 1ly4s0