node.js - 安装 AWS Amplify CLI 时出错
问题描述
我正在尝试使用如下所示的命令安装Amplify CLI 。
npm install -g @aws-amplify/cli
我也按照这篇文章的建议尝试了下面的命令
但是,当我尝试运行它时,安装失败并出现错误:
npm ERR! Unexpected end of JSON input while parsing near '..."^2.2.8","standard":"'
当我查看日志文件时,它给我的信息是。
2105 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '..."^2.2.8","standard":"'
2105 verbose stack at JSON.parse (<anonymous>)
2105 verbose stack at parseJson (C:\Program Files\nodejs\node_modules\npm\node_modules\json-parse-better-errors\index.js:7:17)
2105 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\body.js:96:50
2105 verbose stack at runMicrotasks (<anonymous>)
2105 verbose stack at processTicksAndRejections (internal/process/task_queues.js:97:5)
2106 verbose cwd C:\Windows\system32
2107 verbose Windows_NT 10.0.18362
2108 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "@aws-amplify/cli"
2109 verbose node v12.18.3
2110 verbose npm v6.14.6
2111 error Unexpected end of JSON input while parsing near '..."^2.2.8","standard":"'
2112 verbose exit [ 1, true ]
我正在使用以管理员身份运行的 power shell 窗口安装它。我试图清除 npm 的缓存,但仍然没有运气。
npm cache clean --force
解决方案
推荐阅读
- javascript - 从内容脚本访问堆栈跟踪并将其传递给后台脚本
- powershell - 读取包含通配符的文件路径
- sql-server - 使用“0”参数调用“ExecuteReader”的异常:“',' 附近的语法不正确。”
- angular - 即使我正在导入 FormsModule 也无法绑定到 ngModel 并且语法似乎正确
- javascript - 如何调试在 Firefox (iOS) 上运行的网站?
- sql-server - SQL server 从 sql 表执行 SP 并更新
- c# - 警报监视器触发 azure 功能
- node.js - NodeJs:将标头发送到客户端后无法设置标头
- excel - 基于前 X 个单元格的条件格式
- ios - Xcode 11 - 命令 CodeSign 因非零退出代码而失败。无法为签名者构建自签名根的链