首页 > 解决方案 > 安装 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

标签: node.jsamazon-web-servicesnpmaws-amplify

解决方案


推荐阅读