neoclide / coc-eslint

Eslint extension for coc.nvim
MIT License
396 stars 24 forks source link

[coc.nvim] Command: eslint.executeAutoFix not found #110

Closed EdmundsEcho closed 2 years ago

EdmundsEcho commented 3 years ago

Hello --

I ran into this error about a month ago. I finally started to do some digging to figure out what was going on.

Versions

## versions

vim version: NVIM v0.4.4
node version: v14.15.1
coc.nvim version: 0.0.80-fff2a86b16
coc.nvim directory: /Users/edmund/.config/nvim/bundle/coc.nvim
term: iTerm.app
platform: darwin

eslint channel report

[Info  - 11:43:35 AM] ESLint server is starting
[Info  - 11:43:35 AM] ESLint server running in node v14.15.1
[Info  - 11:43:35 AM] ESLint server is running.
Uncaught exception received.
Error: spawn /Users/edmund/.nvm/versions/node/v14.15.1/bin/node ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
... repeated times

More about the node spawning error

Before drafting this issue, I tracked down what one person found to explain the problem having to do with a missing PATH entry when spawning the node thread.

// ❌This doesn't work:
spawn('node', ['script.js'], {
    env: { NODE_ENV: 'production' }
})

// ✅This works:
spawn('node', ['script.js'], {
    env: {
        NODE_ENV: 'production',
        PATH: process.env.PATH
    }
})

My specific context and question

I'm using nvm so wonder if there is a quirk in accessing the process.env.PATH value in my setup.

This said, in the checkhealth report, my settings seem to be recognized and ok.

health#coc#check
========================================================================
  - OK: Environment check passed

  - OK: Javascript bundle build/index.js found
  - OK: Service started

health#nvim_typescript#check
========================================================================
## Find Node
  - OK: node is in $PATH

## Find Local Typescript
  - WARNING: No local server found, using global
    - ADVICE:
      - Install typescript locally for more accurate tooling
          $ npm install typescript@latest --save-dev

## Find Global Typescript
  - OK: global tsserver is found

## Check for node bindings
  - OK: node bindings found

Note, I can run CocCommand eslint.executeAutofix manually and it seems to work. I get the error in the subject line when I save the buffer to file.


The question

What do you think might be the issue?


More context - CocInfo

Perhaps useful, here are two snippets of the CocInfo output.

  1. A sample of the first few outputs:

## Log of coc.nvim

2021-03-17T11:43:34.892 INFO (pid:3247) [extensions] - Skipped load vim plugin from "/Users/edmund/.config/coc/extensions/node_modules/coc-explorer", "coc-explorer" already global extension.
2021-03-17T11:43:35.038 INFO (pid:3247) [services] - registered service "languageserver.haskell"
2021-03-17T11:43:35.038 INFO (pid:3247) [services] - registered service "languageserver.elmLS"
2021-03-17T11:43:35.191 INFO (pid:3247) [language-client-index] - eslint started with 3249
2021-03-17T11:43:35.211 INFO (pid:3247) [watchman] - watchman watching project: /Volumes/EC_Active/Programming/etl/frontend
2021-03-17T11:43:35.776 INFO (pid:3247) [plugin] - coc.nvim 0.0.80-fff2a86b16 initialized with node: v14.15.1 after 955ms
2021-03-17T11:43:35.814 INFO (pid:3247) [model-installer] - Using npm from: /Users/edmund/.nvm/versions/node/v14.15.1/bin/npm
2021-03-17T11:43:35.818 INFO (pid:3247) [model-installer] - Get info from https://registry.npmjs.org/
2021-03-17T11:43:35.853 INFO (pid:3247) [services] - registered service "tsserver"
2021-03-17T11:43:35.957 INFO (pid:3247) [model-installer] - Current version 1.2.6 is up to date.
2021-03-17T11:43:35.958 INFO (pid:3247) [model-installer] - Using npm from: /Users/edmund/.nvm/versions/node/v14.15.1/bin/npm
2021-03-17T11:43:35.960 INFO (pid:3247) [model-installer] - Get info from https://registry.npmjs.org/
2021-03-17T11:43:36.273 INFO (pid:3247) [attach] - receive notification: highlight []
2021-03-17T11:43:36.633 INFO (pid:3247) [model-installer] - Current version 1.4.5 is up to date.
2021-03-17T11:43:36.634 INFO (pid:3247) [model-installer] - Using npm from: /Users/edmund/.nvm/versions/node/v14.15.1/bin/npm
2021-03-17T11:43:36.636 INFO (pid:3247) [model-installer] - Get info from https://registry.npmjs.org/
2021-03-17T11:43:36.763 INFO (pid:3247) [model-installer] - Current version 0.15.7 is up to date.
2021-03-17T11:43:36.768 INFO (pid:3247) [model-installer] - Using npm from: /Users/edmund/.nvm/versions/node/v14.15.1/bin/npm
2021-03-17T11:43:36.770 INFO (pid:3247) [model-installer] - Get info from https://registry.npmjs.org/
2021-03-17T11:43:37.171 INFO (pid:3247) [model-installer] - Current version 1.0.11 is up to date.
2021-03-17T11:43:37.172 INFO (pid:3247) [model-installer] - Using npm from: /Users/edmund/.nvm/versions/node/v14.15.1/bin/npm
2021-03-17T11:43:37.174 INFO (pid:3247) [model-installer] - Get info from https://registry.npmjs.org/
2021-03-17T11:43:37.248 INFO (pid:3247) [model-installer] - Current version 1.4.1 is up to date.
2021-03-17T11:43:37.249 INFO (pid:3247) [model-installer] - Using npm from: /Users/edmund/.nvm/versions/node/v14.15.1/bin/npm
2021-03-17T11:43:37.250 INFO (pid:3247) [model-installer] - Get info from https://registry.npmjs.org/
2021-03-17T11:43:37.315 INFO (pid:3247) [model-installer] - Current version 1.3.4 is up to date.
2021-03-17T11:43:37.316 INFO (pid:3247) [model-installer] - Using npm from: /Users/edmund/.nvm/versions/node/v14.15.1/bin/npm
2021-03-17T11:43:37.317 INFO (pid:3247) [model-installer] - Get info from https://registry.npmjs.org/
2021-03-17T11:43:37.953 INFO (pid:3247) [model-installer] - Current version 1.1.22 is up to date.
2021-03-17T11:43:37.954 INFO (pid:3247) [model-installer] - Using npm from: /Users/edmund/.nvm/versions/node/v14.15.1/bin/npm
2021-03-17T11:43:37.956 INFO (pid:3247) [model-installer] - Get info from https://registry.npmjs.org/
2021-03-17T11:43:38.046 INFO (pid:3247) [model-installer] - Current version 1.2.13 is up to date.
2021-03-17T11:43:38.047 INFO (pid:3247) [model-installer] - Using npm from: /Users/edmund/.nvm/versions/node/v14.15.1/bin/npm
2021-03-17T11:43:38.048 INFO (pid:3247) [model-installer] - Get info from https://registry.npmjs.org/
2021-03-17T11:43:38.186 INFO (pid:3247) [model-installer] - Current version 0.39.0 is up to date.
2021-03-17T11:43:38.187 INFO (pid:3247) [model-installer] - Using npm from: /Users/edmund/.nvm/versions/node/v14.15.1/bin/npm
2021-03-17T11:43:38.188 INFO (pid:3247) [model-installer] - Get info from https://registry.npmjs.org/
2021-03-17T11:43:38.276 WARN (pid:3247) [events] - Handler of CursorHold blocked more than 2s: Error
    at mq.on (/Users/edmund/.config/nvim/bundle/coc.nvim/build/index.js:133:216)
    at new ZC (/Users/edmund/.config/nvim/bundle/coc.nvim/build/index.js:238:8162)
    at new OP (/Users/edmund/.config/nvim/bundle/coc.nvim/build/index.js:252:90)
    at MP.init (/Users/edmund/.config/nvim/bundle/coc.nvim/build/index.js:254:5504)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async /Users/edmund/.config/nvim/bundle/coc.nvim/build/index.js:129:13445
2021-03-17T11:43:38.291 INFO (pid:3247) [model-installer] - Current version 1.6.8 is up to date.
2021-03-17T11:43:38.292 INFO (pid:3247) [model-installer] - Using npm from: /Users/edmund/.nvm/versions/node/v14.15.1/bin/npm
2021-03-17T11:43:38.294 INFO (pid:3247) [model-installer] - Get info from https://registry.npmjs.org/
2021-03-17T11:43:38.366 INFO (pid:3247) [model-installer] - Current version 1.3.1 is up to date.
2021-03-17T11:43:50.012 INFO (pid:3247) [attach] - receive notification: runCommand [ 'coc-helper.internal.didVimEvent_2', 'CocDiagnosticChange' ]
2021-03-17T11:43:50.434 INFO (pid:3247) [attach] - receive notification: runCommand [ 'coc-helper.internal.didVimEvent_2', 'CocDiagnosticChange' ]
2021-03-17T11:43:50.646 INFO (pid:3247) [attach] - receive notification: runCommand [ 'coc-helper.internal.didVimEvent_2', 'CocDiagnosticChange' ]
2021-03-17T11:43:51.628 INFO (pid:3247) [attach] - receive notification: runCommand [ 'coc-helper.internal.didVimEvent_2', 'CocDiagnosticChange' ]
2021-03-17T11:43:51.765 INFO (pid:3247) [attach] - receive notification: runCommand [ 'coc-helper.internal.didVimEvent_2', 'CocDiagnosticChange' ]
2021-03-17T11:43:52.050 INFO (pid:3247) [attach] - receive notification: runCommand [ 'coc-helper.internal.didVimEvent_2', 'CocDiagnosticChange' ]
2021-03-17T11:43:52.310 INFO (pid:3247) [attach] - receive notification: runCommand [ 'coc-helper.internal.didVimEvent_2', 'CocDiagnosticChange' ]
2021-03-17T11:43:52.962 INFO (pid:3247) [attach] - receive notification: runCommand [ 'coc-helper.internal.didVimEvent_2', 'CocDiagnosticChange' ]
2021-03-17T11:43:58.411 INFO (pid:3247) [attach] - receive notification: runCommand [ 'workspace.clearWatchman' ]
  1. A sample of the latest entries:
2021-03-18T09:24:38.238 INFO (pid:3247) [attach] - receive notification: highlight []
2021-03-18T09:24:44.720 INFO (pid:3247) [attach] - receive notification: runCommand [ 'workspace.clearWatchman' ]
2021-03-18T09:24:47.554 WARN (pid:3247) [events] - Handler of BufEnter blocked more than 2s: Error
    at mq.on (/Users/edmund/.config/nvim/bundle/coc.nvim/build/index.js:133:216)
    at Xe (/Users/edmund/.config/coc/extensions/node_modules/coc-explorer/lib/index.js:301:1603)
    at Zr (/Users/edmund/.config/coc/extensions/node_modules/coc-explorer/lib/index.js:301:1802)
    at new Fv (/Users/edmund/.config/coc/extensions/node_modules/coc-explorer/lib/index.js:321:55045)
    at Object.ere [as activate] (/Users/edmund/.config/coc/extensions/node_modules/coc-explorer/lib/index.js:321:63152)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Object.activate (/Users/edmund/.config/nvim/bundle/coc.nvim/build/index.js:228:1309)
    at async t9.activate (/Users/edmund/.config/nvim/bundle/coc.nvim/build/index.js:225:7187)
    at async t9.setupActiveEvents (/Users/edmund/.config/nvim/bundle/coc.nvim/build/index.js:225:10479)
    at async t9.activateExtensions (/Users/edmund/.config/nvim/bundle/coc.nvim/build/index.js:224:17257)
2021-03-18T09:24:47.599 WARN (pid:3247) [events] - Handler of TermOpen blocked more than 2s: Error
    at mq.on (/Users/edmund/.config/nvim/bundle/coc.nvim/build/index.js:133:216)
    at zj.init (/Users/edmund/.config/nvim/bundle/coc.nvim/build/index.js:186:11227)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async MP.init (/Users/edmund/.config/nvim/bundle/coc.nvim/build/index.js:254:5277)
    at async /Users/edmund/.config/nvim/bundle/coc.nvim/build/index.js:129:13445
2021-03-18T09:24:48.012 INFO (pid:3247) [attach] - receive notification: runCommand [ 'coc-helper.internal.didVimEvent_1', 'BufDelete', 4509 ]
2021-03-18T09:24:48.012 INFO (pid:3247) [attach] - receive notification: runCommand [ 'coc-helper.internal.didVimEvent_2', 'BufDelete', 4509 ]
2021-03-18T09:24:48.014 INFO (pid:3247) [attach] - receive notification: runCommand [ 'coc-helper.internal.didVimEvent_1', 'BufWipeout', 4509 ]
2021-03-18T09:24:48.015 INFO (pid:3247) [attach] - receive notification: runCommand [ 'coc-helper.internal.didVimEvent_2', 'BufWipeout', 4509 ]
2021-03-18T09:25:13.377 INFO (pid:3247) [attach] - receive notification: highlight []
2021-03-18T09:27:51.910 INFO (pid:3247) [attach] - receive notification: highlight []
2021-03-18T09:28:08.931 INFO (pid:3247) [attach] - receive notification: runCommand [ 'eslint.executeAutofix' ]
2021-03-18T09:28:10.017 INFO (pid:3247) [attach] - receive notification: highlight []
2021-03-18T09:28:43.304 INFO (pid:3247) [attach] - receive notification: highlight []

Thank you in advance for any help!

chemzqm commented 2 years ago

Try configure "eslint.runtime" to another node runtime.