rizowski / eslint-watch

ESLint with simple watching capabilities
https://www.npmjs.com/package/eslint-watch
MIT License
194 stars 29 forks source link

Nothing happens #182

Open sarink opened 2 years ago

sarink commented 2 years ago

Environment

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
rizowski commented 2 years ago

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.

sarink commented 2 years ago

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

rizowski commented 2 years ago

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?

jeremysf commented 1 year ago

I am experiencing the same problem.

rijulg commented 1 year ago

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.

moselhy commented 7 months ago

Wasn't working when running esw directly installed by npm i -g esw. It however worked when running it through npx esw