[2017.1.1] ESLint: Please specify ESLint package correctly: ".../bin/eslint.js" file not found

I have nodejs v7.9.0 and npm v4.4.4 on my Windows 8 machine. This version of npm was installed using:

npm install npm@4.4.4 -g

I have also globally installed the javascript 'standard' code quality tool (v10.0.1) using:

npm install standard -g

On Windows, standard's and eslint's lib/bin/conf and similar folders are stored under %APPDATA%\npm, and their package.json files are stored under %APPDATA%\npm-cache. This organization seems to be confusing IntelliJ, because it throws up a red banner on the editor's screen with the message:

ESLint: Please specify ESLint package correctly: ".../bin/eslint.js" file not found

For my configuration in Settings -> Languages & Frameworks -> JavaScript -> Code Quality Tools -> ESLint, I have:

Node interpreter: C:\Program Files\nodejs\node.exe

ESLint package: ~\AppData\Roaming\npm-cache\standard\10.0.1

Configuration file: Automatic search

Additional rules directory: <none>

Extra eslint options: <none>

How can I get IntelliJ to stop complaining about this configuration?

0
7 comments

Please change ESLint package to

 ~\AppData\Roaming\npm\node_modules\standard
0
Avatar
Permanently deleted user

I have tried that configuration, and it produces a different editor error:

Standard Code Style: Can not find package.json under '/'

 

0

hmm... do you have ESLint installed globally?

0

Your issue is likely caused by a major problem with current StandardJS integration: it always tries to use ESLint from node_modules/eslint.
This was not the case before, we picked the right path when we used ESLint CLI, got broken after switching to language service (bug is tracked as https://youtrack.jetbrains.com/issue/WEB-26339).
This can lead to 'ESlint not found' errors and different version compatibility issues.
The workaround for now is: ensure 'standard' and 'eslint' are present side by side (on one level) in your project node_modules (i.e. installed locally), and ESLint version is up-to-date (same as required by standard version you are using)

0
Avatar
Permanently deleted user

Yes, I have found that locally installing 'standard' into the project behaves correctly once I point IntelliJ's configuration at <project-root>/node_modules/standard.

I've given up on trying to get the global install to work.

Thank you for your help!

1
Avatar
Permanently deleted user

Hey Jamartin,

Here's how I installed it globally :

- npm install -g eslint

- use "/usr/local/lib/node_modules/eslint" as ESLint package (on OsX, don't know Windows equivalent)

That should do the trick for you

2
Avatar
Permanently deleted user

@... This comment did it for me after trying and failing for four hours. Hopefully this gets fixed for future users. This morning trying to figure this out was by far my most frustrating experience using a jetBrains product. Thank you!

0

Please sign in to leave a comment.