npm / cmd-shim

The cmd-shim used in npm
ISC License
76 stars 40 forks source link

fix: don't assume cygpath is available #117

Closed davhdavh closed 1 year ago

davhdavh commented 1 year ago

Fixes "cygpath command not found"

References

There are over 1000 bugs on github with "cygpath command not found"

And I am guessing a large part of these is simply because this script generator assumes cygpath is installed.

wraithgar commented 1 year ago

What should actually happen here? If uname contains *CYGWIN*|*MINGW*|*MSYS* but cygpath isn't accessible?

davhdavh commented 1 year ago

The following code already checks if node is in current path or in PATH. That is more than sufficient under normal circumstances.

I added a local cygpath (as an alternative fix) in C:\Program Files\nodejs that just has this amazing implementation:

#!/bin/sh

echo "$2"

ie, a noop operation (assuming it was called with -w path as we do here)

wraithgar commented 1 year ago

It looks like npm run snap needs to be ran, and those changes included in this PR.