简体   繁体   English

npm install @material-ui/core 出错:解析时 JSON 输入意外结束

[英]npm install @material-ui/core got error: Unexpected end of JSON input while parsing

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 npm@6.13.4
3 info using node@v12.13.1
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 ]

use :用 :

npm cache clean --force

See this https://github.com/npm/npm/issues/19072#issuecomment-345555468 I hope that solve your issue.看到这个https://github.com/npm/npm/issues/19072#issuecomment-345555468我希望能解决你的问题。

As I also went to the exact same problem using the NPM , which resulted in getting the same error as above .因为我也使用 NPM 解决了完全相同的问题,这导致了与上述相同的错误。 So instead of NPM i tried to use the yarn and it worked所以我尝试使用纱线而不是 NPM 并且它起作用了

Please try the following command请尝试以下命令

yarn add @material-ui/core

用 ' 包裹 @material-ui/core :

    npm install '@material-ui/core'

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 安装material-ui v3.0.3时JSON输入文件意外结束 - Unexpected end of JSON input file while installing material-ui v3.0.3 在执行“npm install”时,它显示“在'...FFso8TBG3jS7\nYdtExKk'附近解析时,JSON 输入意外结束” - On doing “npm install” it shows “Unexpected end of JSON input while parsing near '…FFso8TBG3jS7\nYdtExKk'” 解析反应时 JSON 输入意外结束 - Unexpected end of JSON input while parsing react 解析时 JSON 输入意外结束 - Unexpected end of JSON input while parsing npm ERR:JSON 输入意外结束,同时在 '...nt“.”^7.1,0“,”babel-p' 附近解析 - npm ERR! Unexpected end of JSON input while parsing near '…nt“:”^7.1.0“,”babel-p' npm 错误! 在“…w2BfLygJAO9ZBvYIqZTld”附近解析时 JSON 输入意外结束 - npm ERR! Unexpected end of JSON input while parsing near '…w2BfLygJAO9ZBvYIqZTld' “ SyntaxError:输入意外结束”。 解析JSON时出错? - 'SyntaxError: Unexpected end of input'. error on parsing JSON? Boilerplate Github repo 不会运行 npm install,ERR! 解析 &#39;...compile-2.0.0-beta.4.t&#39; 附近时 JSON 输入意外结束 - Boilerplate Github repo won't run npm install, ERR! Unexpected end of JSON input while parsing near '...compile-2.0.0-beta.4.t' npm install material-ui 不安装最新版本 - npm install material-ui does not install the latest version 解析异步读取的 json 文件时 JSON 输入意外结束 - Unexpected end of JSON Input while parsing json file read asynchronously
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM