eslint-watch icon indicating copy to clipboard operation
eslint-watch copied to clipboard

Nothing happens

Open sarink opened this issue 2 years ago • 6 comments

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

  1. Command: ./node_modules/.bin/esw --help
  2. 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

sarink avatar Apr 13 '22 12:04 sarink

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.

rizowski avatar Apr 13 '22 13:04 rizowski

./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

sarink avatar Apr 13 '22 18:04 sarink

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?

rizowski avatar Apr 13 '22 20:04 rizowski

I am experiencing the same problem.

jeremysf avatar Jan 21 '23 05:01 jeremysf

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.

rijulg avatar Apr 28 '23 01:04 rijulg