I am trying to create a custom file watcher in WebStorm that will auto fix ESLint errors on save. In Settings > Tools > File Watchers
I created a new file watcher with the following settings:
- File type:
Any
- Scope:
All places
- Program:
/home/user/Projects/todo-app/eslint-autofix.sh
- Arguments: blank
- Output paths to refresh: blank
- Other options > Working directory:
/home/user/Projects/todo-app
eslint-autofix.sh:
#!/usr/bin/env bash
./node_modules/.bin/eslint --fix
Then I made an ESLint error and pressed Ctrl + S to save. The following error pops up:
/home/user/Projects/todo-app/eslint-autofix.sh
/usr/bin/env: ‘node’: No such file or directory
How to fix this error?