oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.13k stars 2.68k forks source link

Package.json backslash escaping is not consistent with Node.JS's #11919

Open wundersolutions-juanjo opened 3 months ago

wundersolutions-juanjo commented 3 months ago

What version of Bun is running?

1.1.13+bd6a60512

What platform is your computer?

Microsoft Windows NT 10.0.19045.0 x64

What steps can reproduce the bug?

What is the expected behavior?

bun run should be consistent with npm run

What do you see instead?

For the provided example, bun run requires another "round" of escaping backslashes, turning it into "start": "bun C:\\\\NodeExpressServer\\\\server.js ./www"

Additional information

No response

museadam commented 2 months ago

Try using the forward slash '/' instead

Or you can also create a bash/powershell script to run the command bun C:\\NodeExpressServer\\server.js ./www to start your server

stefreak commented 1 month ago

This is not a windows issue, it also happens on other platforms and can be very confusing.

This is also a security problem, as it makes it impossible to use double quotes to prevent shell injection in the package.json script