无法安装 typescript 出现以下错误

无法安装 typescript 出现以下错误

当我尝试在 Visual Studio 代码上安装 TypeScript 时出现以下错误:

PS D:\POCProject> npm install -g  typescript
npm WARN tar invalid entry
npm WARN tar invalid entry
npm WARN tar invalid entry
npm WARN tar invalid entry
npm WARN tar invalid entry
npm WARN tar invalid entry
npm WARN tarball tarball data for typescript@latest (sha512-7KxJovlYhTX5RaRbUdkAXN1KUZ8PwWlTzQdHV6xNqvuFOs7+WBo10TQUqT19Q/Jz2hk5v9TQDIhyLhhJY4p5AA==) seems to be corrupted. Trying one more time.
npm WARN tar invalid entry
npm WARN tar invalid entry
npm WARN tar invalid entry
npm WARN tar invalid entry
npm WARN tar invalid entry
npm WARN tar invalid entry
npm WARN tarball tarball data for typescript@latest (sha512-7KxJovlYhTX5RaRbUdkAXN1KUZ8PwWlTzQdHV6xNqvuFOs7+WBo10TQUqT19Q/Jz2hk5v9TQDIhyLhhJY4p5AA==) seems to be corrupted. Trying one more time.
npm ERR! code EINTEGRITY
npm ERR! Verification failed while extracting typescript@latest:
npm ERR! Verification failed while extracting typescript@latest:
npm ERR! sha512-7KxJovlYhTX5RaRbUdkAXN1KUZ8PwWlTzQdHV6xNqvuFOs7+WBo10TQUqT19Q/Jz2hk5v9TQDIhyLhhJY4p5AA== integrity checksum failed when using sha512: wanted sha512-7KxJovlYhTX5RaRbUdkAXN1KUZ8PwWlTzQdHV6xNqvuFOs7+WBo10TQUqT19Q/Jz2hk5v9TQDIhyLhhJY4p5AA== but got sha512-rbMbvn1PJ65kmCxBiew5UiasJIvzF4yL4i3UhJEctZ62plenABwsF7moaNDyJl5dYRqtjhM6f2TWWDKVysNGPA==. (3228 bytes)

npm ERR! A complete log of this run can be found in:
npm ERR!     ..\AppData\Roaming\npm-cache\_logs\2019-07-08T09_10_03_896Z-debug.log

Note:
node -v
v12.0.0

npm -v
6.9.0

protractor --version
Version 5.4.2

我尝试清除缓存并重新启动 webdriver-manager,但没有任何帮助。

有人能建议我还可以采用什么其他方法解决这个问题吗?

相关内容