Robert K. Bell
Robert K. Bell

Reputation: 10234

Have npm create the bin/*.cmd files when installing from Linux?

When using node.js in the WSL, it's inconvenient that running npm install from within the WSL does not create the node_modules/bin/*.cmd files that some Windows-based tools look for.

Is it possible to have these created when I install any package?

Or should I look for a solution that creates them, outside of the npm command?

Upvotes: 1

Views: 331

Answers (1)

WSLUser
WSLUser

Reputation: 631

For node_modules/bin/*.cmd to be created, you'll need to install the Windows version of node. Remember that WSL looks and feels like Linux. The node modules you want created don't exist on Linux, so WSL won't create this either. It is common enough for node to be installed on both Windows and WSL. Just be sure to make your WSL node path appear before your Windows node path. It is generally good practice for all your Windows paths to append at the end of your PATH to allow WSL to try and perform an action using the Linux tools you install first before attempting to use the Windows binary.

Upvotes: 1

Related Questions