Closed lucasfolino closed 7 years ago
@lucasfolino Thanks for reporting this. I need the debug output to understand more of the problem. Can you re-run the command with the environment variable DEBUG
set to esw:*
and paste the output?
Here is the output of DEBUG turned on. It seems to be a path issues. I have tried removing and re-adding eslint. Not sure if it would be possible or difficult to add an eslint path config in either the cli switch or config file.
esw : Mon, 15 May 2017 12:39:39 GMT esw:internal-settings Error: ENOENT: no such file or directory, access
'C:\Users\<username>\node_modules\.bin\eslint.cmd'
At line:1 char:1
+ esw 2> c:\temp\esw.err
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (Mon, 15 May 201...bin\eslint.cmd':String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
at Error (native)
at Object.fs.accessSync (fs.js:249:11)
at loadEslintPath (C:\Users\<username>\AppData\Roaming\npm\node_modules\eslint-watch\src\settings.js:15:8)
at Object.<anonymous> (C:\Users\<username>\AppData\Roaming\npm\node_modules\eslint-watch\src\settings.js:10:20)
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)
C:\Users\<username>\AppData\Roaming\npm\node_modules\eslint-watch\src\settings.js:24
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:20)
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)
@lucasfolino Can you give me the npm version you have too?
Node: 6.10.3 NPM: 3.10.10
Yeah everything is the latest. This is a new setup.
Hmm I re-ran a build to see if it was something new my tests could have caught. But they all passed. https://ci.appveyor.com/project/rizowski/eslint-watch/build/107 Let me try installing this on my windows box and I will get back to you.
@lucasfolino Do you have both eslint and eslint-watch installed globally? Or is one global and the other local? Or both local? How do you have them set up?
I installed them both globally.
I'm not able to reproduce this on my machine. Can you look at C:\Users\%USERNAME%\AppData\Roaming\npm
and see if there is an eslint.cmd
file?
Yes there is. I have no issues running eslint. Any way I can manually change the path in a config file somewhere?
I am noticing the path: ENOENT: no such file or directory, access 'C:\Users\%USERNAME%\node_modules.bin\eslint.cmd' Is incorrect. Shouldn't it be pointing to the :\Users\%USERNAME%\AppData\Roaming\npm folder?
There isn't. Yes, it should be. It's strange that it is looking there. I have two separate Windows machines that run it just fine. This is the logic for finding eslint's path https://github.com/rizowski/eslint-watch/blob/master/src/settings.js#L14
Are you running this through Powershell?
Yes. I also tried it on normal cmd.exe cause I know that PS can cause issues with node sometimes. I just tried removing and adding through cmd.exe as well incase some environment variable causes issues. Still same issue.
@lucasfolino Have you found anything new about this issue?
No I have not. I want to try this on a different machine, and in the WSL Ubuntu environment. If it works there I would consider that a usable workaround.
I am closing this since it seems to only happen on one machine.
the same issue happend with me.
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\user\AppData\Roaming\npm\node_modules\eslint-w atch\src\settings.js:24:13)
I found C:\Users\user\AppData\Roaming\npm\node_modules\eslint-watch\src\settings.js is not exist.
you not publish the setting file to npmjs.com .npmignore
src
Environment: node v8.1.3 npm 5.0.3 eslint 4.1.1 (in global) eslint-watch@3.1.2 (in global)
/src/setting.js maybe a better way to get eslintPath: excute command:
npm root -g
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.
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.
Environment
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
esw ...
Debug output: