expo-cli icon indicating copy to clipboard operation
expo-cli copied to clipboard

npm ERR! Unexpected end of JSON input while parsing near '...","mocha":"^3.2.0"

Open MahmoudMabrok opened this issue 7 years ago • 10 comments

I:\RN\rn>npm install --global expo-cli
npm ERR! Unexpected end of JSON input while parsing near '...","mocha":"^3.2.0","s'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\motamed\AppData\Roaming\npm-cache\_logs\2019-10-23T17_17_45_512Z-debu
g.log
node: 9.9.0
npm: 5.6.0

MahmoudMabrok avatar Oct 23 '19 18:10 MahmoudMabrok

step 1)

$ npm cache clean --force or

$ npm cache verify step 2)

$ npm install -g @angular/cli@latest or

try uninstalling and installing angular/cli

step 3)

$ npm install --save-dev @angular/cli@latest step 4)

delete node_modules and run $ npm install

Celfin avatar Oct 30 '19 09:10 Celfin

thanks @Celfin i used npm cache clean --force and it solved the problem.

MahmoudMabrok avatar Oct 31 '19 11:10 MahmoudMabrok

Looks like it was some kind of transient network error / corrupted npm cache. Glad the problem is solved now!

fson avatar Nov 14 '19 15:11 fson

thanks @Celfin I used this command $ npm cache clean --force and iit solved this issue.

sohelrana76 avatar Mar 14 '20 08:03 sohelrana76

E:\git-test>npm install lite-server --save-dev npm ERR! Unexpected end of JSON input while parsing near '...mocha":"^1.21.4","sin'

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Sasi\AppData\Roaming\npm-cache_logs\2020-03-25T14_45_43_024Z-debug.log

node v12.16.1 npm 6.13.4

I even getting this error after all ur previous steps is to be followed

Sasi-007 avatar Mar 25 '20 14:03 Sasi-007

Thanks Dear @Celfin i used this code npm cache clean --force and solved it in my cmd thanks....

hackerpatel avatar May 06 '20 10:05 hackerpatel

Thanks

Paulo1661 avatar May 17 '20 22:05 Paulo1661

Thank you so much @Celfin npm cache clean --force worked for me

SiphenathiM avatar Jul 15 '20 15:07 SiphenathiM

**Getting this issue while expo-init ** Choose a template: expo-template-blank

🧶 Using Yarn to install packages. You can pass --npm to use npm instead.

× Something went wrong in downloading and extracting the project files. invalid json response body at https://registry.npmjs.org/expo-template-blank reason: Unexpected end of JSON input FetchError: invalid json response body at https://registry.npmjs.org/expo-template-blank reason: Unexpected end of JSON input at C:\Users\Anurag Gharat\AppData\Local\Yarn\Data\global\node_modules\minipass-fetch\lib\body.js:77:31 at extractTemplateAppAsync (C:@expo\[email protected]\src\Exp.ts:167:3) at Object.extractAndPrepareTemplateAppAsync (C:@expo\[email protected]\src\Exp.ts:131:3) at action (C:\Users\Anurag Gharat\AppData\Local\Yarn\Data\global\node_modules\expo-cli\src\commands\init.ts:181:19) at Command. (C:\Users\Anurag Gharat\AppData\Local\Yarn\Data\global\node_modules\expo-cli\src\exp.ts:80:7)

anuraggharat avatar Jul 28 '20 06:07 anuraggharat

**Getting this issue while expo-init ** Choose a template: expo-template-blank

🧶 Using Yarn to install packages. You can pass --npm to use npm instead.

× Something went wrong in downloading and extracting the project files. invalid json response body at https://registry.npmjs.org/expo-template-blank reason: Unexpected end of JSON input FetchError: invalid json response body at https://registry.npmjs.org/expo-template-blank reason: Unexpected end of JSON input at C:\Users\Anurag Gharat\AppData\Local\Yarn\Data\global\node_modules\minipass-fetch\lib\body.js:77:31 at extractTemplateAppAsync (C:@expo\[email protected]\src\Exp.ts:167:3) at Object.extractAndPrepareTemplateAppAsync (C:@expo\[email protected]\src\Exp.ts:131:3) at action (C:\Users\Anurag Gharat\AppData\Local\Yarn\Data\global\node_modules\expo-cli\src\commands\init.ts:181:19) at Command. (C:\Users\Anurag Gharat\AppData\Local\Yarn\Data\global\node_modules\expo-cli\src\exp.ts:80:7)

How did you fix this?

awalmubarak avatar Sep 24 '20 14:09 awalmubarak