Failed to load the ESLint library for the document... (Windows 10, WSL)
See original GitHub issueThis works fine for me in macOS. I’m having this issue in Windows:
[Info - 8:46:29 PM] ESLint server stopped.
[Info - 8:46:30 PM] ESLint server running in node v8.9.3
[Info - 8:46:30 PM] ESLint server is running.
[Info - 8:46:30 PM] Failed to load the ESLint library for the document Untitled-1
To use ESLint for single JavaScript file install eslint globally using 'npm install -g eslint'.
If you are using yarn or pnpm instead of npm set the setting `eslint.packageManager` to either `yarn` or `pnpm`
You need to reopen VS Code after installing eslint.
Repro steps:
Setup WSL and environment
- Enable WSL
- Install an Ubuntu version from the Windows Store
👇 in Ubuntu - Go through setup; Install Node.js and npm LTS
- Modify npm
prefix
to use path owned by me and notroot
- Install
eslint
globally (npm -g i eslint
) - Add
.eslintrc
file to~/
👇 back in Windows - Install VS Code Stable
- Open VS Code
👇 in VS Code
Setup VS Code
- Install ESLint extension (
dbaeumer.vscode-eslint
) - View > Command Palette… >
Terminal: Select Default Shell
>WSL Bash
Final steps
- Close VS Code; Open VS Code (via Windows taskbar shortcut / start menu)
- File > New File
- View > Command Palette… >
Change Language Mode
>JavaScript
- View > Output
- Select ESLint in output provider list
- Output: See log at beginning of this post
- View > Terminal
- Execute the following commands:
node -v && npm -v
v10.15.0
6.4.1
npm -g prefix
/home/jesse/.npm-global
npm -g ls --depth 0
/home/jesse/.npm-global/lib
└── eslint@5.13.0
which eslint
/home/jesse/.npm-global/bin/eslint
eslint -v
v5.13.0
Do I need to do something else?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Failed to load the ESLint library for the document... ...
Setup WSL and environment · Enable WSL · Install an Ubuntu version from the Windows Store in Ubuntu · Go through setup; Install...
Read more >ESLint not working in VS Code?
If it shows Failed to load the ESLint library for the document {documentName}.js -or- if the Problems tab shows an error or a...
Read more >Install Node.js on Windows Subsystem for Linux (WSL2)
A guide to help you get your Node.js development environment set up on Windows Subsystem for Linux (WSL).
Read more >Configuration Files - 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 >ESLint on WSL not work when mount point '/mnt/c' is ...
Go to Settings > Language & Frameworks > Javascript > Code Quality Tools > ESLint · uncheck "Enable".
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
@dbaeumer So I will need to install another extension before being able to use ESLint in Windows? I’m confused.
Will you please elaborate here what steps will be needed (starting from a fresh Windows 10 installataion) to get ESLint working in VS Code through WSL?
@jsejcksn A good documentation on how to use this is here: https://code.visualstudio.com/docs/remote/wsl#_getting-started
The benefit of this approach is that not only the ESLint runs in WSL but also language support and debugging. So it is a more holistic solution then only running ESLint in WSL.
Please note that the general WSL support in VS Code is currently only available in Insider. But it will come to stable.