android - nativescript - 提取 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)
清除缓存并删除platforms
和node_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.使用此命令更新nativescript:-
npm install -g nativescript
2.如果您的代码未使用 nativescript 6 迁移,请使用以下命令:-
tns migrate
3.更新您的项目 node_modules 和 tns_core_modules 后:-
tns update
4.添加平台
tns platform add android
推荐阅读
- symfony - 如何使用 symfony/mailer 和 symfony/mailgun-mailer 提供商标记电子邮件
- python - 求数效率平方根的算法
- javascript - 动画总是触发,因为状态总是在 React 中滚动时发生变化
- vuejs2 - vee-validate 3 的有效格式是什么?
- android - 如何在改造中解析 Restfull api JSON 响应?
- mongodb - 聚合一个 MongoDB 数组只返回多个元素数组
- typescript - 如何使用 jest 在模拟响应中获取响应状态?
- sql-server - SQL 语法 1.* 这是什么意思?
- java - TestContainers PostgreSQLContainer 与 Kotlin 单元测试:“没有足够的信息来推断类型变量 SELF”
- javascript - 函数对象和 ES 模块的作用域问题