Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install coc-prettier #57

Open
numToStr opened this issue May 3, 2020 · 6 comments
Open

Unable to install coc-prettier #57

numToStr opened this issue May 3, 2020 · 6 comments
Labels
question Further information is requested

Comments

@numToStr
Copy link

numToStr commented May 3, 2020

When I try to install coc-prettier via let g:coc_global_extensions, I get this error:

Screenshot_20200503_184020

Screenshot_20200503_184344

I debug the npm log and I found this

1845 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...2","esprima":"git://g'
1845 verbose stack     at JSON.parse (<anonymous>)
1845 verbose stack     at parseJson (/home/hello/n/lib/node_modules/npm/node_modules/json-parse-better-errors/index.js:7:17)
1845 verbose stack     at /home/hello/n/lib/node_modules/npm/node_modules/node-fetch-npm/src/body.js:96:50
1845 verbose stack     at runMicrotasks (<anonymous>)
1845 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:97:5)
1846 verbose cwd /tmp/coc-prettier-qKGAyH
1847 verbose Linux 5.6.8-1-MANJARO
1848 verbose argv "/home/hello/n/bin/node" "/home/hello/n/bin/npm" "install" "--ignore-scripts" "--no-lockfile" "--production"
1849 verbose node v12.16.1
1850 verbose npm  v6.13.4
1851 error Unexpected end of JSON input while parsing near '...2","esprima":"git://g'
1852 verbose exit [ 1, true ]
@chemzqm chemzqm added the question Further information is requested label May 3, 2020
@chemzqm
Copy link
Member

chemzqm commented May 3, 2020

Don't know what's wrong with your npm.

@Mikhael1729
Copy link

I've had a similar issue. I solved it as follows:

  1. Downgrade npm to version 4.6.1: npm install -g [email protected]
  2. Open nvim and run: :CocInstall coc-prettier

That's all!

@numToStr
Copy link
Author

numToStr commented May 5, 2020

@Mikhael1729 That npm is way too old.

@Mikhael1729
Copy link

Mikhael1729 commented May 5, 2020

@Mikhael1729 That npm is way too old.

Previously to that indicated version, I tried with npm version 5.10.0, I think perhaps, a version between 4.6.1 and 5.10.0 works well too. I need to try!

@numToStr
Copy link
Author

numToStr commented May 5, 2020

Perhaps a newer version works well. I need to try it.

IDK but this issue comes with only npm. If you do this it will work.

Plug "neoclide/coc-prettier", { do: "yarn install --frozen-lockfile" }

@guidiamond
Copy link

Plug 'neoclide/coc-prettier', { 'do': 'yarn install --frozen-lockfile' }

use single quotes in everything if you're using vim-plug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants