Using a local eslint makes node load a shell script
See original GitHub issueRunning windows 10, sublime text 3, ESLint-Formatter 2.1.1.
I just created an empty project and installed eslint locally. I have auto-format turned on on ESLint-Formatter config.
Seemingly 1 in 5 saves, eslint tries to load from the local eslint, and the other 4 it uses global. I assume this is probably #17 causing it to not always find the local eslint.
Whenever it uses the global eslint, it loads node with %APPDATA%/npm/node_modules/eslint/bin/eslint which is a Javascript file, and works great. However…
Whenever it uses the local eslint, it loads node with node_modules/.bin/eslint which is a shell file, and causes this to pop up as an error message:
Unexpected error(<class 'Exception'>): Error: <project>\node_modules\.bin\eslint:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
at Object.exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:513:28)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
at Module.runMain (module.js:575:10)
at run (node.js:348:7)
at startup (node.js:140:9)
at node.js:463:3
I’d suggest looking for node_modules/eslint/bin/eslint for local installations instead.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Getting Started with ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >NPM — How to Run ESLint --fix From npm Script - Future Studio
This tutorial shows you how to run ESLint with the --fix flag from an NPM script. NPM Quick Tips Series Overview. NPM Quick...
Read more >How to configure package.json to run eslint script
I have setup eslint using tern in my eclipse oxygen. It is linting all the files, I have to set it up to...
Read more >How To Lint and Format Code with ESLint in Visual Studio Code
In this case, eslint is a package that is only needed when you are actively working on and making changes to your project....
Read more >ESLint | IntelliJ IDEA Documentation - JetBrains
IntelliJ IDEA integrates with ESLint which brings a wide range of linting ... Make sure a local Node.js interpreter is configured in your ......
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 Free
Top 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

For me, on windows, it’s a shell script:
Yeah, that seems like a reasonable approach, thanks.