2
npm install @material-ui/core
npm ERR! Unexpected end of JSON input while parsing near '...X1F+dSMvv9bUwJSg+lOUX'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\WR-022\AppData\Roaming\npm-cache\_logs\2020-03-19T15_48_14_800Z-debug.log

debug.log

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\WR-022\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   '@material-ui/core'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session c306ec592b524249
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 304 https://registry.npmjs.org/@material-ui%2fcore 1376ms (from cache)
8 silly fetchPackageMetaData error for @material-ui/core@latest Unexpected end of JSON input while parsing near '...X1F+dSMvv9bUwJSg+lOUX'
9 timing stage:rollbackFailedOptional Completed in 1ms
10 timing stage:runTopLevelLifecycles Completed in 4080ms
11 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...X1F+dSMvv9bUwJSg+lOUX'
11 verbose stack     at JSON.parse (<anonymous>)
11 verbose stack     at parseJson (C:\Users\WR-022\AppData\Roaming\npm\node_modules\npm\node_modules\json-parse-better-errors\index.js:7:17)
11 verbose stack     at C:\Users\WR-022\AppData\Roaming\npm\node_modules\npm\node_modules\node-fetch-npm\src\body.js:96:50
11 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:93:5)
12 verbose cwd E:\corporate-new-ui
13 verbose Windows_NT 10.0.18362
14 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\WR-022\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "@material-ui/core"
15 verbose node v12.13.1
16 verbose npm  v6.13.4
17 error Unexpected end of JSON input while parsing near '...X1F+dSMvv9bUwJSg+lOUX'
18 verbose exit [ 1, true ]
2
  • update react and react-dom to the latest versionnpm install --save react@latest then npm install --save react-dom@latest then try again with npm install @material-ui/core Commented Mar 19, 2020 at 16:05
  • I tried it but that didn't help. the problem still persists Commented Mar 20, 2020 at 4:58

3 Answers 3

2

use :

npm cache clean --force

See this https://github.com/npm/npm/issues/19072#issuecomment-345555468 I hope that solve your issue.

Sign up to request clarification or add additional context in comments.

Comments

2

Wrap @material-ui/core with ' :

    npm install '@material-ui/core'

Comments

0

As I also went to the exact same problem using the NPM , which resulted in getting the same error as above . So instead of NPM i tried to use the yarn and it worked

Please try the following command

yarn add @material-ui/core

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.