简体   繁体   English

Typescript编译器失败,退出代码为1

[英]Typescript compiler failed with exit code 1

i am using nativescript to develop mobile app project, i ve used photoviewer plugin, and it works fine when debuging the app in my phone but when i try to publish the app, iget always this error 我正在使用nativescript开发移动应用程序项目,我使用过photoviewer插件,并且在手机中调试应用程序时效果很好,但是当我尝试发布该应用程序时,总是会收到此错误

Found peer TypeScript 3.1.6 找到对等的TypeScript 3.1.6

node_modules/nativescript-photoviewer/photoviewer.d.ts(48,22): error TS2304: Cannot find name 'UIColor'. node_modules / nativescript-photoviewer / photoviewer.d.ts(48,22):错误TS2304:找不到名称“ UIColor”。

node_modules/nativescript-photoviewer/photoviewer.d.ts(54,24): error TS2304: Cannot find name 'UIColor'. node_modules / nativescript-photoviewer / photoviewer.d.ts(54,24):错误TS2304:找不到名称“ UIColor”。

node_modules/nativescript-photoviewer/photoviewer.d.ts(60,23): error TS2304: Cannot find name 'UIColor'. node_modules / nativescript-photoviewer / photoviewer.d.ts(60,23):错误TS2304:找不到名称“ UIColor”。

node_modules/nativescript-photoviewer/photoviewer.d.ts(89,13): error TS2304: Cannot find name 'UIImage'. node_modules / nativescript-photoviewer / photoviewer.d.ts(89,13):错误TS2304:找不到名称“ UIImage”。

node_modules/nativescript-photoviewer/photoviewer.d.ts(94,24): error TS2304: >Cannot find name 'UIImage'. node_modules / nativescript-photoviewer / photoviewer.d.ts(94,24):错误TS2304:>找不到名称“ UIImage”。 TypeScript compiler failed with exit code 1 TypeScript编译器失败,退出代码为1

i ve tried to delete hooks, node_modules and platform folder and rerun npm install but nothing works, i ll be so gratefull if any one help Thank you 我试图删除钩子,node_modules和platform文件夹并重新运行npm install,但是没有任何效果,如果有任何帮助,我将非常感激谢谢

Try adding 尝试添加

"skipLibCheck": true

on compilerOptions in tsconfig.json compilerOptionstsconfig.json

Or alternatively you could configure tns-platform-declarations plugin in your project. 或者,您也可以在项目中配置tns-platform-declarations插件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM