weirongxu / coc-explorer

📁 Explorer for coc.nvim
MIT License
1.14k stars 45 forks source link

[BUG] Coc Command: explorer not found #555

Closed gaoyajun02 closed 1 year ago

gaoyajun02 commented 1 year ago

Describe the bug

Recently (about half a month ago) I can't open explorer in nvim, When I try to open explore, an error will be reported

Coc Command: explorer not found

It seems that nvim does not have a normal home in explore.

Result from CocInfo

## versions

vim version: NVIM v0.4.4
node version: v10.12.0
coc.nvim version: 0.0.80-c90a07eec8
coc.nvim directory: /opt/mt/gyj/.config/nvim/plugged/coc.nvim
term: screen-256color
platform: linux

## Log of coc.nvim

2023-01-03T15:15:56.008 WARN (pid:14162) [attach] - Plugin not ready when received "runCommand" [ 'explorer' ]
2023-01-03T15:15:56.229 ERROR (pid:14162) [extensions] - Error on createExtension coc-explorer from /opt/mt/gyj/.config/coc/extensions/node_modules/coc-explorer/lib/index.js /opt/mt/gyj/.config/coc/extensions/node_modules/coc-explorer/lib/index.js:8049
  return s.toString().split("").map((c) => subscriptTable[c] ?? c).join("");
                                                              ^

SyntaxError: Unexpected token ?
    at new Script (vm.js:79:7)
    at createScript (vm.js:251:10)
    at Object.runInContext (vm.js:284:10)
    at Module._compile (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:77087:36)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Module.require (internal/modules/cjs/loader.js:636:17)
    at Object.sandboxRequire [as require] (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:77121:46)
2023-01-03T15:15:56.308 INFO (pid:14162) [services] - registered service "highlight"
2023-01-03T15:15:56.559 ERROR (pid:14162) [extensions] - Error on active extension coc-prettier: TypeError: import_coc6.window.onDidChangeActiveTextEditor is not a function
    at PrettierEditService.registerDisposables (/opt/mt/gyj/.config/coc/extensions/node_modules/coc-prettier/lib/index.js:4506:49)
    at Object.activate (/opt/mt/gyj/.config/coc/extensions/node_modules/coc-prettier/lib/index.js:5044:153)
    at Object.activate (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:49629:57)
    at Extensions.activate (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:49350:41)
    at Extensions.setupActiveEvents (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:49510:24)
    at Extensions.activateExtensions (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:48965:24)
    at process._tickCallback (internal/process/next_tick.js:68:7) TypeError: import_coc6.window.onDidChangeActiveTextEditor is not a function
    at PrettierEditService.registerDisposables (/opt/mt/gyj/.config/coc/extensions/node_modules/coc-prettier/lib/index.js:4506:49)
    at Object.activate (/opt/mt/gyj/.config/coc/extensions/node_modules/coc-prettier/lib/index.js:5044:153)
    at Object.activate (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:49629:57)
    at Extensions.activate (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:49350:41)
    at Extensions.setupActiveEvents (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:49510:24)
    at Extensions.activateExtensions (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:48965:24)
    at process._tickCallback (internal/process/next_tick.js:68:7)
2023-01-03T15:15:56.746 INFO (pid:14162) [language-client-index] - highlight started with 14206
2023-01-03T15:15:56.821 INFO (pid:14162) [services] - registered service "vimlsp"
2023-01-03T15:15:56.822 INFO (pid:14162) [services] - vim language server state change: stopped => starting
2023-01-03T15:15:56.847 INFO (pid:14162) [language-client-index] - vimlsp started with 14214
2023-01-03T15:15:56.855 INFO (pid:14162) [plugin] - coc.nvim 0.0.80-c90a07eec8 initialized with node: v10.12.0 after 815ms
2023-01-03T15:15:57.118 INFO (pid:14162) [attach] - receive notification: runCommand [ 'explorer' ]
2023-01-03T15:15:57.227 INFO (pid:14162) [services] - vim language server state change: starting => running
2023-01-03T15:15:57.231 INFO (pid:14162) [services] - service vimlsp started
2023-01-03T15:15:58.845 INFO (pid:14162) [attach] - receive notification: runCommand [ 'explorer' ]
2023-01-03T15:15:59.326 INFO (pid:14162) [attach] - receive notification: runCommand [ 'explorer' ]
2023-01-03T15:16:01.557 INFO (pid:14162) [attach] - receive notification: openLog []
2023-01-03T15:16:42.738 INFO (pid:14162) [attach] - receive notification: doAutocmd [ 1,
  { regcontents:
     [ 'SyntaxError: Unexpected token ?',
       '    at new Script (vm.js:79:7)' ],
    inclusive: true,
    regname: '',
    operator: 'y',
    regtype: 'V' },
  2,
  1000 ]
2023-01-03T15:17:36.999 INFO (pid:14162) [attach] - receive notification: doAutocmd [ 1,
  { regcontents:
     [ '2023-01-03T15:15:56.008 WARN (pid:14162) [attach] - Plugin not ready when received "runCommand" [ \'explorer\' ]',
       '2023-01-03T15:15:56.229 ERROR (pid:14162) [extensions] - Error on createExtension coc-explorer from /opt/mt/gyj/.config/coc/extensions/node_modules/coc-explorer/lib/index.js /opt/mt/gyj/.config/coc/extensions/node_modules/coc-explorer/lib/index.js:8049',
       '  return s.toString().split("").map((c) => subscriptTable[c] ?? c).join("");',
       '                                                              ^',
       '',
       'SyntaxError: Unexpected token ?',
       '    at new Script (vm.js:79:7)',
       '    at createScript (vm.js:251:10)',
       '    at Object.runInContext (vm.js:284:10)',
       '    at Module._compile (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:77087:36)',
       '    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)',
       '    at Module.load (internal/modules/cjs/loader.js:598:32)',
       '    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)',
       '    at Function.Module._load (internal/modules/cjs/loader.js:529:3)',
       '    at Module.require (internal/modules/cjs/loader.js:636:17)',
       '    at Object.sandboxRequire [as require] (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:77121:46)',
       '2023-01-03T15:15:56.308 INFO (pid:14162) [services] - registered service "highlight"',
       '2023-01-03T15:15:56.559 ERROR (pid:14162) [extensions] - Error on active extension coc-prettier: TypeError: import_coc6.window.onDidChangeActiveTextEditor is not a function',
       '    at PrettierEditService.registerDisposables (/opt/mt/gyj/.config/coc/extensions/node_modules/coc-prettier/lib/index.js:4506:49)',
       '    at Object.activate (/opt/mt/gyj/.config/coc/extensions/node_modules/coc-prettier/lib/index.js:5044:153)',
       '    at Object.activate (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:49629:57)',
       '    at Extensions.activate (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:49350:41)',
       '    at Extensions.setupActiveEvents (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:49510:24)',
       '    at Extensions.activateExtensions (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:48965:24)',
       '    at process._tickCallback (internal/process/next_tick.js:68:7) TypeError: import_coc6.window.onDidChangeActiveTextEditor is not a function',
       '    at PrettierEditService.registerDisposables (/opt/mt/gyj/.config/coc/extensions/node_modules/coc-prettier/lib/index.js:4506:49)',
       '    at Object.activate (/opt/mt/gyj/.config/coc/extensions/node_modules/coc-prettier/lib/index.js:5044:153)',
       '    at Object.activate (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:49629:57)',
       '    at Extensions.activate (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:49350:41)',
       '    at Extensions.setupActiveEvents (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:49510:24)',
       '    at Extensions.activateExtensions (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:48965:24)',
       '    at process._tickCallback (internal/process/next_tick.js:68:7)',
       '2023-01-03T15:15:56.746 INFO (pid:14162) [language-client-index] - highlight started with 14206',
       '2023-01-03T15:15:56.821 INFO (pid:14162) [services] - registered service "vimlsp"',
       '2023-01-03T15:15:56.822 INFO (pid:14162) [services] - vim language server state change: stopped => starting',
       '2023-01-03T15:15:56.847 INFO (pid:14162) [language-client-index] - vimlsp started with 14214',
       '2023-01-03T15:15:56.855 INFO (pid:14162) [plugin] - coc.nvim 0.0.80-c90a07eec8 initialized with node: v10.12.0 after 815ms',
       '2023-01-03T15:15:57.118 INFO (pid:14162) [attach] - receive notification: runCommand [ \'explorer\' ]',
       '2023-01-03T15:15:57.227 INFO (pid:14162) [services] - vim language server state change: starting => running',
       '2023-01-03T15:15:57.231 INFO (pid:14162) [services] - service vimlsp started',
       '2023-01-03T15:15:58.845 INFO (pid:14162) [attach] - receive notification: runCommand [ \'explorer\' ]' ],
    inclusive: true,
    regname: '',
    operator: 'y',
    regtype: 'V' },
  2,
  1000 ]
2023-01-03T15:18:20.879 INFO (pid:14162) [attach] - receive notification: showInfo []

Log of coc.nvim

2023-01-03T15:27:18.096 ERROR (pid:13733) [extensions] - Error on createExtension coc-explorer from /opt/mt/gyj/.config/coc/extensions/node_modules/coc-explorer/lib/index.js /opt/mt/gyj/.config/coc/extensions/node_modules/coc-explorer/lib/index.js:8049
  return s.toString().split("").map((c) => subscriptTable[c] ?? c).join("");
                                                              ^

SyntaxError: Unexpected token ?
    at new Script (vm.js:79:7)
    at createScript (vm.js:251:10)
    at Object.runInContext (vm.js:284:10)
    at Module._compile (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:77087:36)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Module.require (internal/modules/cjs/loader.js:636:17)
    at Object.sandboxRequire [as require] (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:77121:46)
2023-01-03T15:27:18.191 INFO (pid:13733) [services] - registered service "highlight"
2023-01-03T15:27:18.437 ERROR (pid:13733) [extensions] - Error on active extension coc-prettier: TypeError: import_coc6.window.onDidChangeActiveTextEditor is not a function
    at PrettierEditService.registerDisposables (/opt/mt/gyj/.config/coc/extensions/node_modules/coc-prettier/lib/index.js:4506:49)
    at Object.activate (/opt/mt/gyj/.config/coc/extensions/node_modules/coc-prettier/lib/index.js:5044:153)
    at Object.activate (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:49629:57)
    at Extensions.activate (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:49350:41)
    at Extensions.setupActiveEvents (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:49510:24)
    at Extensions.activateExtensions (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:48965:24)
    at process._tickCallback (internal/process/next_tick.js:68:7) TypeError: import_coc6.window.onDidChangeActiveTextEditor is not a function
    at PrettierEditService.registerDisposables (/opt/mt/gyj/.config/coc/extensions/node_modules/coc-prettier/lib/index.js:4506:49)
    at Object.activate (/opt/mt/gyj/.config/coc/extensions/node_modules/coc-prettier/lib/index.js:5044:153)
    at Object.activate (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:49629:57)
    at Extensions.activate (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:49350:41)
    at Extensions.setupActiveEvents (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:49510:24)
    at Extensions.activateExtensions (/opt/mt/gyj/.config/nvim/plugged/coc.nvim/build/index.js:48965:24)
    at process._tickCallback (internal/process/next_tick.js:68:7)
2023-01-03T15:27:18.616 INFO (pid:13733) [language-client-index] - highlight started with 13773
2023-01-03T15:27:18.667 INFO (pid:13733) [plugin] - coc.nvim 0.0.80-c90a07eec8 initialized with node: v10.12.0 after 706ms
2023-01-03T15:27:21.170 INFO (pid:13733) [attach] - receive notification: openLog []

Steps to reproduce Steps to reproduce the behavior:

  1. execute nvim
  2. :CocCommand explorer<CR>
  3. See error
Coc Command: explorer not found
weirongxu commented 1 year ago

https://github.com/neoclide/coc.nvim#quick-start nodejs >= 14.14

gaoyajun02 commented 1 year ago

https://github.com/neoclide/coc.nvim#quick-start nodejs >= 14.14

Thank you very much, I will upgrade nodejs and try again

gaoyajun02 commented 1 year ago

Oh, I remembered that my server os version is too old. Due to glibc problems, I cannot use a higher version of nodejs.

node: /lib64/libc.so.6: version `GLIBC_2.16' not found (required by node)
node: /lib64/libc.so.6: version `GLIBC_2.17' not found (required by node)
node: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by node)
node: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.14' not found (required by node)
node: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.18' not found (required by node)
node: /usr/lib64/libstdc++.so.6: version `CXXABI_1.3.5' not found (required by node)
node: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by node)

so I must use a lower version of coc, and does coc-explorer have an adapted lower version, or is there any way to specify it to a certain A coc-explorer version @weirongxu

weirongxu commented 1 year ago

Specified version example:

CocInstall coc-explorer@xx.xx

weirongxu commented 1 year ago

Also, you can try some nodejs version managers, like, asdf-vm, n