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

Unexpected end of JSON input while parsing when installing vue-cli #587

Closed
k9yosh opened this issue Sep 12, 2017 · 14 comments
Closed

Unexpected end of JSON input while parsing when installing vue-cli #587

k9yosh opened this issue Sep 12, 2017 · 14 comments

Comments

@k9yosh
Copy link

k9yosh commented Sep 12, 2017

When i try to install vue-cli via npm i get the following error.

C:\Users\yomal.ds\Desktop\VueJS>npm install --global vue-cli
npm ERR! Unexpected end of JSON input while parsing near '...},"dist":{"shasum": "8'
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\yomal.ds\AppData\Roaming\npm-cache\_logs\2017-09-12T06_55_ 53_890Z-debug.log

I tried npm cache clean and reinstalling npm.
Debug log is attached. Log.txt

OS : Win 7 x64
npm : v5.4.1
Node : v8.0.0

@posva
Copy link
Member

posva commented Sep 13, 2017

Try updating your node version

@k9yosh
Copy link
Author

k9yosh commented Sep 14, 2017

@posva I was running on Node 8.0.0, and i upgraded to 8.5.0. Now it leads to another error. This was the initial error i got, but then the above error started coming.

npm ERR! path C:\Users\yomal.ds\AppData\Roaming\npm\node_modules\vue-cli\node_modules\fsevents\nod
e_modules\abbrev\package.json
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\yomal.ds\AppData\Roaming\npm\node
_modules\vue-cli\node_modules\fsevents\node_modules\abbrev\package.json'
npm ERR! { Error: EPERM: operation not permitted, unlink 'C:\Users\yomal.ds\AppData\Roaming\npm\n
ode_modules\vue-cli\node_modules\fsevents\node_modules\abbrev\package.json'
npm ERR! stack: 'Error: EPERM: operation not permitted, unlink 'C:\Users\yomal.ds\AppData\R
oaming\npm\node_modules\vue-cli\node_modules\fsevents\node_modules\abbrev\package.json'',

npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'C:\Users\yomal.ds\AppData\Roaming\npm\node_modules\vue-cli\node_modules
\fsevents\node_modules\abbrev\package.json' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\yomal.ds\AppData\Roaming\npm-cache_logs\2017-09-14T08_16_12_166Z-debug.log

PS : I am running as Administrator

@posva
Copy link
Member

posva commented Sep 14, 2017

In that case, I'll let you search for the error which seems unrelated to vue-cli, if it turns out we need to modify vue-cli code to fix it, please, come back and ping me. Sorry but I really don't know what is the origin of the error

@posva posva closed this as completed Sep 14, 2017
@k9yosh
Copy link
Author

k9yosh commented Sep 14, 2017

Downgrading to npm v5.3 worked for me. It's a npm 5.4 bug npm/npm#18380

@posva
Copy link
Member

posva commented Sep 14, 2017

oh, thanks for sharing 😄

@guozuji
Copy link

guozuji commented Sep 20, 2017

Thanks

@rahul230691
Copy link

Downgraded to npm v5.3, still didn't work for me. Had to downgrade to npm v4.6.1 and it worked fine.

@kels-orien
Copy link

thanks. did the same, worked for me too

@AdhamRammadan
Copy link

npm cache clean --force

also helps

@MikeTatsky
Copy link

@AdhamRammadan
Thank you :)
It helped.

@aminehck
Copy link

I had to execute the command below:

npm config set registry http://registry.npmjs.org/
However, that will make npm install packages over an insecure HTTP connection. If you can, you should stick with

npm config set registry https://registry.npmjs.org/
instead to install over HTTPS.

@itsminani
Copy link

I tried doing npm cache clean --force and it worked fine for me

@shyamzzp
Copy link

shyamzzp commented Jun 9, 2020

npm cache clean --force
@AdhamRammadan

It worked and helped.

@arifikhsan
Copy link

npm WARN using --force I sure hope you know what you are doing.

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

No branches or pull requests