如何解决打字稿不兼容-NativeScript CLI v7和angular / compiler 10.1.0
环境
提供以下组件的版本号(可以通过在项目文件夹中运行tns info
或通过检查项目的package.json
来检索信息)
- CLI:7.0.6
- 跨平台模块:v7.0.0
- Android运行时:v7.0.0
- iOS运行时:v7.0.0
- 插件:
描述错误
在将我的项目更新/迁移到v7打字稿版本时,将设置为v3.9.7,以投诉NativeScript CLI v7。 这会导致启动应用程序时出现问题。
splash34$ tns debug android
Searching for devices...
Copying template files...
+ @nativescript/android@7.0.0
updated 1 package and audited 1393 packages in 5.909s
⠇ found 1 high severity vulnerability
run `npm audit fix` to fix them,or `npm audit` for details
Platform android successfully added. v7.0.0
Preparing project...
File change detected. Starting incremental webpack compilation...
webpack is watching the files…
Hash: 2082db08eadcf65243cc
Version: webpack 4.44.1
Time: 2766ms
Built at: 09/05/2020 10:39:28 PM
4 assets
Entrypoint bundle = runtime.js vendor.js bundle.js
[../package.json] 1.84 KiB {bundle} [optional] [built]
[./app.scss] 61 KiB {bundle} [built]
[./main.ts] 1.13 KiB {bundle} [built]
+ 329 hidden modules
ERROR in The Angular Compiler requires TypeScript >=3.4.0 and <3.6.0 but 3.9.7 was found instead.
现在将“打字稿”降级为“ 3.5.3”时,我们将收到一条错误消息,说明该应用程序不再兼容。
splash34$ tns debug android
The current application is not compatible with NativeScript CLI 7.0.
Run 'ns migrate' to migrate your project to NativeScript 7.
Alternatively you may try running it with '--force' to skip this check.
要复制
具有以下依赖项的安装项目:
"dependencies": {
"@angular/animations": "10.1.0","@angular/common": "10.1.0","@angular/compiler": "10.1.0","@angular/core": "10.1.0","@angular/forms": "10.1.0","@angular/http": "^7.2.16","@angular/platform-browser": "10.1.0","@angular/platform-browser-dynamic": "10.1.0","@angular/router": "10.1.0","@nativescript/angular": "10.1.0","@nativescript/core": "7.0.0","@nativescript/theme": "~2.3.0","nativescript-background-http": "^4.2.1","nativescript-camera": "^4.5.0","nativescript-fancyalert": "^3.0.9","nativescript-feedback": "^1.5.0","nativescript-material-datetimepicker": "^1.0.9","nativescript-modal-datetimepicker-fixed-color": "^1.1.10","nativescript-theme-core": "~1.0.6","nativescript-ui-listview": "^7.1.0","nativescript-ui-sidedrawer": "^7.0.4","node-blob": "0.0.2","npm": "^6.14.8","reflect-metadata": "~0.1.12","rxjs": "^6.6.2","swagger-angular-generator": "^4.2.2","zone.js": "~0.9.1"
},"devDependencies": {
"@angular/compiler-cli": "^8.2.14","@nativescript/android": "7.0.0","@nativescript/ios": "7.0.0","@nativescript/types": "~7.0.0","@nativescript/webpack": "~3.0.0","@ngtools/webpack": "~8.2.0","codelyzer": "~4.5.0","ng-swagger-gen": "^1.8.1","node-sass": "^4.14.1","prettier": "^1.19.1","tslint": "~5.11.0","typescript": "~3.9.7"
}
预期的行为
使用仿真器升级后启动应用程序。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。