nativescript - 提取 tns 时验证失败-android

nativescript - Verification failed while extracting tns-android

这是我得到的错误!我不知道下一步该做什么!

$ tns platform add android
Copying template files...
Verification failed while extracting tns-android@6.4.1:
sha512-gPHZi4EA+f39jvJRt5DTSA19Yk0jPAeWWxABd26GUbEU43i1ISnIg0/en42MeWaUjHDXk1Fc1hPXWbIcoEjKiQ== integrity checksum failed when using sha512: wanted sha512-gPHZi4EA+f39jvJRt5DTSA19Yk0jPAeWWxABd26GUbEU43i1ISnIg0/en42MeWaUjHDXk1Fc1hPXWbIcoEjKiQ== but got sha512-AfBUS4i8o0XL1i9MWw0eYhjeM1UW8KOXUbyGInhdPmpytri11XZsPBPE2ToNavy1ljo/rTw3/NBzpD5UP09Llg==. (7416194 bytes)

我也在我的 package.json 中手动更改了版本,这发生了:

Verification failed while extracting tns-android@6.5.0:
sha512-L7vxid4dSGD6CRS9I2HXCeovuSnChCPNmgmScv5K2qIAOLwcPHcQ77oI3gqEWzMIcNDYjmVFGDR0qjzaKxmydw== integrity checksum failed when using sha512: wanted sha512-L7vxid4dSGD6CRS9I2HXCeovuSnChCPNmgmScv5K2qIAOLwcPHcQ77oI3gqEWzMIcNDYjmVFGDR0qjzaKxmydw== but got sha512-pleOzs6WMvCDiueDSYDy4NQ1e2eTJmSUEAZqAnIjdW/Fp5qpBf/WRAwOPrg7aMl9Zgi4Eyb+CkSpVFN+cJ/kfg==. (9054579 bytes)

清除缓存并删除 platformsnode_modules 目录是可行的,但是当我尝试清除 npm cache 而不 --force 时我得到了这个,为什么?

$ npm cache clean        
npm ERR! As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead. On the other hand, if you're debugging an issue with the installer, you can use `npm install --cache /tmp/empty-cache` to use a temporary cache instead of nuking the actual one.
npm ERR! 
npm ERR! If you're sure you want to delete the entire cache, rerun this command with --force.

尝试使用 nativescript 6.5.0 更新您的项目。

1.Update nativescript 使用此命令:-

npm install -g nativescript

2.If 您的代码未使用 nativescript 6 迁移,然后使用此命令:-

tns migrate

3.After 更新您的项目 node_modules 和 tns_core_modules:-

tns update

4.Add 平台

tns platform add android