Fails to run on Windows when eslint is installed globally.
See original GitHub issueEnvironment
- Node Version: v6.10.3
- Eslint-Watch Version: 3.10
- Eslint Version: 3.19.0
Basic Description of the problem
When running esw I get that eslint-watch cannot find eslint. The command esw will not run at all even with -h, --esw-version.
How to reproduce it
- Command:
esw ...
- …
Debug output:
// to grab debug output set DEBUG=esw:*
throw new Error('Eslint needs to be installed globally or locally in node_modules.');
^
Error: Eslint needs to be installed globally or locally in node_modules.
at loadEslintPath (C:\Users\<username>\AppData\Roaming\npm\node_modules\eslint-watch\src\settings.js:24:13)
at Object.<anonymous> (C:\Users\<username>\AppData\Roaming\npm\node_modules\eslint-watch\src\settings.js:10:
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Users\<username>\AppData\Roaming\npm\node_modules\eslint-watch\src\index.js:4:1)
Issue Analytics
- State:
- Created 6 years ago
- Comments:19 (8 by maintainers)
Top Results From Across the Web
How to install ESlint globally? - Stack Overflow
To install eslint globally: npm install -g eslint. To install eslint in your project folder: npm install eslint --save-dev · Add in package.json ......
Read more >Getting Started with ESLint - Pluggable JavaScript Linter
You can install and configure ESLint using this command: ... It is also possible to install ESLint globally, rather than locally, using npm...
Read more >Linting JavaScript in Visual Studio - Microsoft Learn
This package can be installed locally in each project where you want to enable linting, or you can install it globally using npm...
Read more >ESLint | WebStorm Documentation - JetBrains
Install ESLint · In the embedded Terminal ( Alt+F12 ) , type one of the following commands: npm install --g eslint for global...
Read more >eslint-plugin-react - npm
It is also possible to install ESLint globally rather than locally (using npm install eslint --global). However, this is not recommended, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am closing this since it seems to only happen on one machine.
Same problem here. Seems like it is looking in local, not in global. File eslint.cmd actually is in C:\Users\pk\AppData\Roaming\npm
Environment: node v8.11.2 npm 5.6.0 eslint 5.4.0 (in global) eslint-watch@4.0.2 (in global)
Debug-Output (in Powershell, same in cmd) PS D:\tfs\IMSware\Mobile\IMS.IMSWARE.HelpDesk\APP.HelpDesk> $env:DEBUG=“esw:*” PS D:\tfs\IMSware\Mobile\IMS.IMSWARE.HelpDesk\APP.HelpDesk> esw -v esw:internal-settings Error: ENOENT: no such file or directory, access ‘D:\tfs\IMSware\Mobile\IMS.IMSWARE.HelpDesk\APP.HelpDesk\node_modules.bin\eslint.cmd’ esw:internal-settings at Object.fs.accessSync (fs.js:301:11) esw:internal-settings at accessSync (C:\Users\pk\AppData\Roaming\npm\node_modules\eslint-watch\src\settings.js:16:8) esw:internal-settings at Object.<anonymous> (C:\Users\pk\AppData\Roaming\npm\node_modules\eslint-watch\src\settings.js:11:20) esw:internal-settings at Module._compile (module.js:652:30) esw:internal-settings at Object.Module._extensions…js (module.js:663:10) esw:internal-settings at Module.load (module.js:565:32) esw:internal-settings at tryModuleLoad (module.js:505:12) esw:internal-settings at Function.Module._load (module.js:497:3) esw:internal-settings at Module.require (module.js:596:17) esw:internal-settings at require (internal/module.js:11:18) +0ms
C:\Users\pk\AppData\Roaming\npm\node_modules\eslint-watch\src\settings.js:25 throw new Error(‘Eslint needs to be installed globally or locally in node_modules.’); ^ Error: Eslint needs to be installed globally or locally in node_modules: node_modules.bin\eslint.cmd at loadEslintPath (C:\Users\pk\AppData\Roaming\npm\node_modules\eslint-watch\src\settings.js:25:13) at Object.<anonymous> (C:\Users\pk\AppData\Roaming\npm\node_modules\eslint-watch\src\settings.js:11:20) at Module._compile (module.js:652:30) at Object.Module._extensions…js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3) at Module.require (module.js:596:17) at require (internal/module.js:11:18) at Object.<anonymous> (C:\Users\pk\AppData\Roaming\npm\node_modules\eslint-watch\src\index.js:4:1)