Errors Installing AWS Amplify CLI

Viewed 306

I am trying to install the Amplify CLI with the command shown below.

npm install -g @aws-amplify/cli

I have also tried the command below as this post suggested

However when I try running it the install fails with the error:

npm ERR! Unexpected end of JSON input while parsing near '..."^2.2.8","standard":"'

When I look into the log files the information it is giving me is.

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 ]

I am installing it using a power shell window run as an admin. I have tried to clear the cache for npm but still no luck.

npm cache clean --force
0 Answers
Related