Closed thedanheller closed 2 years ago
That usually means that the node you run here and the eslint version do not match.
I've tried Node v 10, 11 and 12, no success :/
You probably have a sophisticated setup and environment. Make sure it works on the command line and start Sublime from the Terminal using subl . so it inherits the environment from the Terminal process.
I'm having the exact same issue, and my setup is far from sophisticated. I'm going as bare bones as possible just to get eslint running again (it's been a while).
subl .
./node_modules/eslint/bin/eslint.js .
works fineIf I manually fix the optional catch so it looks like } catch (e) {
then I get a whole new error:
/Users/{MY_PROJECT_PATH}/node_modules/eslint/lib/eslint/eslint.js:175
...unknownOptions
^^^
SyntaxError: Unexpected token ...
at NativeCompileCache._moduleCompile (/Users/{MY_PROJECT_PATH}/node_modules/v8-compile-cache/v8-compile-cache.js:240:18)
at Module._compile (/Users/{MY_PROJECT_PATH}/node_modules/v8-compile-cache/v8-compile-cache.js:184:36)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (/Users/{MY_PROJECT_PATH}/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
at Object.<anonymous> (/Users/{MY_PROJECT_PATH}/node_modules/eslint/lib/eslint/index.js:3:20)
at Module._compile (/Users/{MY_PROJECT_PATH}/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
I'd appreciate any help!
SOLVED
For me, the issue was sublime pathing to an old version of node. I had to reinstall/update NVM.
If anyone else has this issue, I just threw a console.log('node version', process.version)
toward the beginning of the .../eslint/bin/eslint.js script. That helped me see that sublime's node version was bad. I'm sure there's a better way to check.
Closing as it old anyway but also has been discussed upstream at the eslint repo.
I'm using:
And SublimeLinter / eslint throws this error: