npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

Support setting up .bin for Windows when installing via Linux (WSL)

I often switch between WSL & Windows when developing, especially when contributing to open source projects.

When npm creates .bin, if it’s running on the Windows host it’ll setup .cmd, .ps1, and shell scripts - as such, I can run .bin commands in cmd, powershell, and wsl.

However, if I install within wsl, since it’s linux it just creates links to the js files.

It’d be nice if I could do something like npm i --force-all-bin-script-types to have npm create all the scripts it would if it was running on Windows, even when running in WSL/Linux.

This could further be extended to supporting having npm grab binaries for npm packages such as node-sass for both platforms, but that’s less of an issue.