The npm community forum has been discontinued.
To discuss usage of npm, visit the GitHub Support Community.
cygpath not found on windows with MINGW shell
What I Wanted to Do
eslint cannot run from bash shell on Windows because cygpath is not found.
What Happened Instead
sh.exe"-3.1$ ./node_modules/.bin/eslint --version ./node_modules/.bin/eslint: line 5: cygpath: command not found internal/modules/cjs/loader.js:583 throw err; ^ Error: Cannot find module 'd:\eslint\bin\eslint.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15) at Function.Module._load (internal/modules/cjs/loader.js:507:25) at Function.Module.runMain (internal/modules/cjs/loader.js:742:12) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3) sh.exe"-3.1$
Anyway, commenting the following lines in ./node_modules/.bin/eslint makes eslint works without problems:
case `uname` in *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; esac
I reinstalled MINGW and MSYS just to see if cygpath is installed with some package, but was unable to find it (also the package cygutil does not provide cygpath). I suggest to change the case to detect only
*CYGWIN* or remove it altogether.
The workaround is to change in my scripts
Tell us about your environment
- ESLint Version: 6.3.0
- Node Version: 10.15.0
npm Version: 6.11.3
Windows 10 64bits
Using MSYS and MINGW (unknown version) to emulate Unix shell
$ npm --versions <!-- paste output here --> $ node -p process.platform win32 <!-- paste output here -->
Same problem with
ncu installed globally.
cygpath is not needed in MinGW and MSYS because these systems magically convert paths in the right way.
So please fix this. I cannot use anymore any npm installed program after the last upgrade.