npm安装错误,在解析附近时JSON输入意外结束

问题描述 投票:0回答:1
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:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'react-bootstrap',
1 verbose cli   'bootstrap'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 4004d1d4d37ac517
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 200 https://registry.npmjs.org/react-bootstrap 521ms
8 silly fetchPackageMetaData error for react-bootstrap@latest Unexpected end of JSON input while parsing near '...,"requirejs":"~2.1.9"'
9 http fetch GET 200 https://registry.npmjs.org/bootstrap 521ms
10 silly fetchPackageMetaData error for bootstrap@latest Unexpected end of JSON input while parsing near '...7bc2df7ec608869c9c8",'
11 timing stage:rollbackFailedOptional Completed in 0ms
12 timing stage:runTopLevelLifecycles Completed in 3560ms
13 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...,"requirejs":"~2.1.9"'
13 verbose stack     at JSON.parse (<anonymous>)
13 verbose stack     at parseJson (C:\Program Files\nodejs\node_modules\npm\node_modules\json-parse-better-errors\index.js:7:17)
13 verbose stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\body.js:96:50
13 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:97:5)
14 verbose cwd D:\Talk2Tutor\material-kit-react-master
15 verbose Windows_NT 10.0.17134
16 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "react-bootstrap" "bootstrap"
17 verbose node v12.17.0
18 verbose npm  v6.14.4
19 error Unexpected end of JSON input while parsing near '...,"requirejs":"~2.1.9"'
20 verbose exit [ 1, true ]

我在运行npm时遇到了错误,我react-bootstrap引导程序。错误发生后,我尝试了[[npm cache clean --force,但无法解决我的问题。然后,我重新安装的节点并尝试安装依赖项,但仍然出现错误,安装失败。任何人都可以修复此错误。我尝试了相关问题中提到的所有事情。但这并不能解决我的问题。我使用节点v12.17.0和npm 6.14.4。

node.js reactjs npm npm-install
1个回答
0
投票
Popper.js是必需的,如果您使用的是Bootstrap JS。检查docs
© www.soinside.com 2019 - 2024. All rights reserved.