簡體   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

調試日志

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 ]

用 :

npm cache clean --force

看到這個https://github.com/npm/npm/issues/19072#issuecomment-345555468我希望能解決你的問題。

因為我也使用 NPM 解決了完全相同的問題,這導致了與上述相同的錯誤。 所以我嘗試使用紗線而不是 NPM 並且它起作用了

請嘗試以下命令

yarn add @material-ui/core

用 ' 包裹 @material-ui/core :

    npm install '@material-ui/core'

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM