前提・実現したいこと
Typescriptを使うことになり、Node.jsをインストールしてnpmでインストールを試みています。
コマンドプロンプトより
npm install -g typescript
を実行しているのですが、必ずエラーとなりインストール失敗します。
どなたかアドバイスなどいただけますでしょうか?
発生している問題・エラーメッセージ
npm ERR! Unexpected end of JSON input while parsing near '...yGXPpwpiVVNa\nRdRWCmp' npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\user\AppData\Roaming\npm-cache\_logs\2018-09-04T13_32_30_590Z-debug.log
ログファイルの内容
0 info it worked if it ends with ok 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 '-g', 1 verbose cli 'typescript' ] 2 info using npm@6.2.0 3 info using node@v10.9.0 4 verbose npm-session e2e9d5c18ce5d973 5 silly install loadCurrentTree 6 silly install readGlobalPackageData 7 http fetch GET 304 https://registry.npmjs.org/typescript 1318ms (from cache) 8 silly fetchPackageMetaData error for typescript@latest Unexpected end of JSON input while parsing near '...yGXPpwpiVVNa\nRdRWCmp' 9 timing stage:rollbackFailedOptional Completed in 3ms 10 timing stage:runTopLevelLifecycles Completed in 1778ms 11 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...yGXPpwpiVVNa\nRdRWCmp' 11 verbose stack at JSON.parse (<anonymous>) 11 verbose stack at parseJson (C:\Program Files\nodejs\node_modules\npm\node_modules\json-parse-better-errors\index.js:7:17) 11 verbose stack at consumeBody.call.then.buffer (C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\body.js:96:50) 11 verbose stack at process._tickCallback (internal/process/next_tick.js:68:7) 12 verbose cwd C:\WINDOWS\system32 13 verbose Windows_NT 10.0.17134 14 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "-g" "typescript" 15 verbose node v10.9.0 16 verbose npm v6.2.0 17 error Unexpected end of JSON input while parsing near '...yGXPpwpiVVNa\nRdRWCmp' 18 verbose exit [ 1, true ]

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/09/07 02:54