【发布时间】:2023-03-07 05:57:01
【问题描述】:
运行命令 npm install -g @angular/cli 时出现上述错误 完整的日志如下
verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...ain" : "src/index.js"'
78 verbose stack at JSON.parse (<anonymous>)
78 verbose stack at parseJson (C:\Program Files\nodejs\node_modules\npm\node_modules\json-parse-better-errors\index.js:7:17)
78 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\body.js:96:50
78 verbose stack at processTicksAndRejections (internal/process/task_queues.js:97:5)
79 verbose cwd C:\Users\E079233\Coinnov\CoInnovUI
80 verbose Windows_NT 10.0.17763
81 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "@angular/cli"
82 verbose node v12.18.2
83 verbose npm v6.14.5
84 error Unexpected end of JSON input while parsing near '...ain" : "src/index.js"'
85 verbose exit [ 1, true ]
我按照另一个答案的建议尝试了 npm cache clean --force 和 npm install @angular/cli@latest,但没有成功
请提出解决此问题的可能方法。
【问题讨论】:
标签: node.js angular npm npm-install npm-start