neoclide / coc-tsserver

Tsserver extension for coc.nvim that provide rich features like VSCode for javascript & typescript
MIT License
1.06k stars 68 forks source link

Is it necessary to force using the coc core 0.0.82? #438

Closed Konata9 closed 1 year ago

Konata9 commented 1 year ago

I am using the iSH (an alpine Linux v3.14) on iPad. I tried to run npm ci on the latest coc.nvim (v0.0.82) but got the error. node v16.20.1 with npm=6.14.18. So, I changed the coc.nvim to version v0.0.81. Then I got error on installing coc-tsserver, the error message shows needs the coc core v0.0.82.

So, is it necessary to force using the coc-core 0.0.82? If not, how can I install in the lower version?

fannheyward commented 1 year ago

npm ci on the latest coc.nvim

Do you use the latest master branch or the 0.0.82 tag release?

Konata9 commented 1 year ago

Yes. I'm using the latest master branch and got the error. Then I tried to install under the folder ~/.vim/plugged/coc.nvim and still got the error.

Plug 'neoclide/coc.nvim', {'branch': 'master', 'do': 'npm ci'}

fannheyward commented 1 year ago

Can you post the error message? coc.nvim's master changed to use npm in last week, I need some feedback for this.

Konata9 commented 1 year ago

OK. I cloned the latest repo from the GitHub page, then went to the folder and ran npm ci. Here are the logs.

13:23:23 with maochichen in coc.nvim at MacBook-Pro-2 on  master is 📦 v0.0.82 via ⬢ v16.20.1
➜ node -v
v16.20.1

13:23:25 with maochichen in coc.nvim at MacBook-Pro-2 on  master is 📦 v0.0.82 via ⬢ v16.20.1
➜ npm --version
6.14.18

13:23:30 with maochichen in coc.nvim at MacBook-Pro-2 on  master is 📦 v0.0.82 via ⬢ v16.20.1
➜ npm ci
npm ERR! Cannot read properties of undefined (reading '@chemzqm/neovim')

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/maochichen/.npm/_logs/2023-09-04T05_23_32_958Z-debug.log

Here is the full log 2023-09-04T05_23_32_958Z-debug.log

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/Users/maochichen/.nvm/versions/node/v16.20.1/bin/node',
1 verbose cli   '/Users/maochichen/.nvm/versions/node/v16.20.1/bin/npm',
1 verbose cli   'ci'
1 verbose cli ]
2 info using npm@6.14.18
3 info using node@v16.20.1
4 verbose npm-session b14074fbcaa4b44a
5 info prepare initializing installer
6 verbose prepare starting workers
7 verbose prepare installation prefix: /Users/maochichen/Workspace/coc.nvim
8 verbose prepare using package-lock.json
9 verbose checkLock verifying package-lock data
10 verbose teardown shutting down workers.
11 info teardown Done in 0.001s
12 verbose stack TypeError: Cannot read properties of undefined (reading '@chemzqm/neovim')
12 verbose stack     at /Users/maochichen/.nvm/versions/node/v16.20.1/lib/node_modules/npm/node_modules/lock-verify/index.js:27:40
12 verbose stack     at Array.forEach (<anonymous>)
12 verbose stack     at /Users/maochichen/.nvm/versions/node/v16.20.1/lib/node_modules/npm/node_modules/lock-verify/index.js:25:25
13 verbose cwd /Users/maochichen/Workspace/coc.nvim
14 verbose Darwin 22.6.0
15 verbose argv "/Users/maochichen/.nvm/versions/node/v16.20.1/bin/node" "/Users/maochichen/.nvm/versions/node/v16.20.1/bin/npm" "ci"
16 verbose node v16.20.1
17 verbose npm  v6.14.18
18 error Cannot read properties of undefined (reading '@chemzqm/neovim')
19 verbose exit [ 1, true ]
yaegassy commented 1 year ago

@Konata9 It seems that the issue is occurring with the version of npm you are currently using. As a workaround, please try upgrading to the latest npm version that is available for Node 16 and see if that resolves the issue.

e.g.

npm i -g npm@8.19.4
yaegassy commented 1 year ago

Hmm... it appears that this issue is likely related to the lockfileVersion of package-lock-json on the coc.nvim itself.

Konata9 commented 1 year ago

@yaegassy You mean the package-lock.json is too high in the coc.nvim? I saw the lockfileVersion is 3, which means I need to use the npm9 to do the installation ?

yaegassy commented 1 year ago

@Konata9

3: The lockfile version used by npm v9. Backwards compatible to npm v7.

I think npm v7 or later is fine.

fannheyward commented 1 year ago

https://nodejs.org/en/download/releases

Upgrade your npm please.

Konata9 commented 1 year ago

@yaegassy @yaegassy Thanks guys. I tried on my iPad with npm 9, and the dependencies have downloaded successfully but are stuck in the npm run build process.

I guess it may related to the platform, iSH is a 32-bit Linux system but everything works fine on my Mac. I will use the older v0.0.81 on my iPad.

Thanks for your help again.

chemzqm commented 1 year ago

Use release branch of coc.nvim is recommended.