coc-eslint: [coc.nvim] Failed to load the ESLint library for the document test.js
I’m just now getting more “serious” about using Coc in my development machine - and I’m trying to use this extension as a replacement for ALE by suggestion from this article but unfortunately I’m getting some pretty buggy behavior.
When I load a javascript file (any file) I see warnings that are legit warnings (like the neovim “sign” / gutter indicator is there) but I see the error in this issue summary at the bottom
However, if I play around enough (not sure what triggers it, but spamming $
and 0
in normal mode on a line where a sign exists eventually triggers the expected warning (and btw this one in particular I’d love to turn off but I realize its an existing annoyance for others):
I did try `:CocUpdateSync and got this output:
:!yarnpkg upgrade --latest --ignore-engines
[No write since last change]
yarn upgrade v1.13.0
warning package.json: No license field
warning No license field
warning No license field
warning No license field
[1/4] Resolving packages...
warning coc-prettier > prettier-eslint > eslint > file-entry-cache > flat-cache > circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
warning coc-prettier > prettier-stylelint > stylelint > autoprefixer > browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "coc-prettier > prettier-tslint@0.4.2" has unmet peer dependency "typescript@^2.5.3 || ^3.0.0".
warning "coc-prettier > prettier-tslint > tslint@5.16.0" has unmet peer dependency "typescript@>=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev
|| >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >=3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev".
warning "coc-prettier > prettier-tslint > tslint > tsutils@2.29.0" has unmet peer dependency "typescript@>=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=
2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >= 3.0.0-dev || >= 3.1.0-dev".
[4/4] Rebuilding all packages...
success Saved lockfile.
warning No license field
success Saved 365 new dependencies.
Is that warning anything special?
I’d greatly appreciate any help here 😃
:CocInfo Output
## versions
vim version: NVIM v0.3.2-dev
node version: v10.15.3
coc.nvim version: 0.0.65-5effa64974
term: iTerm.app
platform: darwin
## Error messages
## Output channel: prettier
[Trace - 4/26/2019, 1:34:45 PM:] Formatted file: file:///Users/foobar/temp/test.js
[Trace - 4/26/2019, 1:34:45 PM:] Prettier format edits: [
{
"range": {
"start": {
"character": 0,
"line": 0
},
"end": {
"character": 0,
"line": 16
}
},
"newText": "var debug = require(\"debug\");\n\n// A comment\n\nfunction sayHi() {\n console.log(\"hi\");\n}\n\naksayHi();\n\nasdfl;\nj: w;\n"
}
]
## Output channel: tsserver
[Info - 1:34:32 PM] Forking TSServer
PATH: /Users/foobar/.yarn/bin:/Users/foobar/.config/yarn/global/node_modules/.bin:/var/folders/nl/ry78xgy13djdd9ntz2vfkq240000gn/T/fnm-shell-299137/bin:/Users/foobar/.fnm:/opt/local/bin:/opt/local/sbin:/Users/foobar/.pyenv/plugins/pyenv-virtualenv/shims:/Users/foobar/.pyenv/shims:/Users/foobar/.pyenv/bin:/usr/local/sbin:/usr/local/bin:/Users/foobar/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/usr/local/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Wireshark.app/Contents/MacOS:/Users/foobar/.yarn/bin:/Users/foobar/.config/yarn/global/node_modules/.bin:/var/folders/nl/ry78xgy13djdd9ntz2vfkq240000gn/T/fnm-shell-3942512/bin:/Users/foobar/.fnm:/opt/local/bin:/opt/local/sbin:/Users/foobar/.pyenv/plugins/pyenv-virtualenv/shims:/Users/foobar/.pyenv/shims:/Users/foobar/.pyenv/bin:/Users/foobar/.cargo/bin
[Info - 1:34:32 PM] Started TSServer
{
"path": "/Users/foobar/.config/coc/extensions/node_modules/coc-tsserver/node_modules/typescript/lib",
"_pathLabel": "",
"_api": {
"versionString": "3.3.4000",
"version": "3.3.4000"
}
}
## Output channel: eslint
[Info - 1:34:32 PM] ESLint server running in node v10.15.3
:CocConfig
{
"suggest.echodocSupport": true,
"suggest.maxCompleteItemCount": 20,
"coc.preferences.formatOnSaveFiletypes": ["javascript", "typescript", "typescriptreact", "json", "javascriptreact"],
"eslint.filetypes": ["javascript", "typescript", "typescriptreact", "javascriptreact"],
"eslint.options": {
"configFile": "~/.eslintrc"
},
"diagnostic.errorSign": "•",
"diagnostic.warningSign": "•",
"diagnostic.infoSign": "•"
}
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 22 (8 by maintainers)
Same issue for me with coc-prettier and coc-eslint After manually install dependencies on dev folder work like as expected
npm install --save-dev eslint prettier eslint-config-prettier eslint-plugin-prettier
(Node.js 14)Checkout your npm global module folder by
npm root -g
and make sure your have eslint inside that folder.@kevindashgit Then you need to specify
eslint.nodePath
For me the problem was that I’ve installed
eslint
using Yarn, and so I have to set: