eslint-watch
eslint-watch copied to clipboard
Nothing happens
Environment
- Node Version: 17.3.1
- Eslint-Watch Version: 8.0.0
- Eslint Version: 8.13.0
Basic Description of the problem
How to reproduce it
- Command:
./node_modules/.bin/esw --help
- Nothing happens
Debug output:
DEBUG=esw:* ./node_modules/.bin/esw --help
esw:eslint-help Loaded +0ms
esw:main [ '--help' ] +0ms
esw:main ESW: v8.0.0 +1ms
esw:eslint Executing [ '--help' ] +0ms
esw:eslint Error: Command failed with ENOENT: eslint --help
esw:eslint spawn eslint ENOENT
esw:eslint at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
esw:eslint at onErrorNT (node:internal/child_process:475:16)
esw:eslint at processTicksAndRejections (node:internal/process/task_queues:83:21) +8ms
Where is eslint installed? Local node_modules or globally? This error is saying it doesn't exist in either location. Also note you are running a limited supported node version for Esling-Watch. In the past I've found bugs like this occur and resolve before LTS.
./node_modules/.bin/eslint
exists and is what I was thinking this package would use.
I just tried with node 16.13.2
, same result
It should look in your project node_modules and then global. Can you try invoking esw within the context of npx, package.json scripts or yarn?
I am experiencing the same problem.
you have to run it as
yarn run esw
or
npm run esw
I am not sure why this works but directly calling the executable doesn't, but probably something to do with node setting up env vars.