Vue-cli: Unexpected end of JSON input while parsing when installing vue-cli

Created on 12 Sep 2017  路  14Comments  路  Source: vuejs/vue-cli

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

Most helpful comment

npm cache clean --force

also helps

All 14 comments

Try updating your node version

@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.dsAppData\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.dsAppData\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.dsAppData\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.dsAppData\Roaming\npm-cache_logs\2017-09-14T08_16_12_166Z-debug.log

PS : I am running as Administrator

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

Downgrading to npm v5.3 worked for me. It's a npm 5.4 bug https://github.com/npm/npm/issues/18380

oh, thanks for sharing 馃槃

Thanks

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

thanks. did the same, worked for me too

npm cache clean --force

also helps

@AdhamRammadan
Thank you :)
It helped.

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.

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

npm cache clean --force
@AdhamRammadan

It worked and helped.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sanderswang picture sanderswang  路  3Comments

BusyHe picture BusyHe  路  3Comments

brandon93s picture brandon93s  路  3Comments

JIANGYUJING1995 picture JIANGYUJING1995  路  3Comments

OmgImAlexis picture OmgImAlexis  路  3Comments