排名
6
文章
6
粉丝
16
评论
8
{{item.articleTitle}}
{{item.blogName}} : {{item.content}}
ICP备案 :渝ICP备18016597号-1
网站信息:2018-2024TNBLOG.NET
技术交流:群号656732739
联系我们:contact@tnblog.net
公网安备:50010702506256
欢迎加群交流技术
分类:
ionic
报错信息:Cannot find type definition file for'@typeds'
当我尝试使用命令'ionic cordova build android --prod --release'在android中构建应用程序时,它在Windows上正常工作
在ios中使用相同命令(在Mac上)对接,给我这个错误:
10:35:55] typescript error Cannot find type definition file for '@types'. [10:35:55] ionic-app-script task: "build" [10:35:55] Error: Failed to transpile TypeScript Error: Failed to transpile TypeScriptat errorCheckProgram (/Users/zakaria/Desktop/untitled folder/transatour/node_modules/@ionic/app-scripts/dist/aot/aot- compiler.js:119:39)at Object.<anonymous> (/Users/zakaria/Desktop/untitled folder/transatour/node_modules/@ionic/app-scripts/dist/aot/aot- compiler.js:89:21)at step (/Users/zakaria/Desktop/untitled folder/transatour/node_modules/@ionic/app-scripts/dist/aot/aot- compiler.js:32:23)at Object.next (/Users/zakaria/Desktop/untitled folder/transatour/node_modules/@ionic/app-scripts/dist/aot/aot- compiler.js:13:53)at fulfilled (/Users/zakaria/Desktop/untitled folder/transatour/node_modules/@ionic/app-scripts/dist/aot/aot- compiler.js:4:58)[ERROR] An error occurred while running subprocess ionic-app- scripts. ionic-app-scripts build --prod --target cordova --platform ios exited with exit code 1. Re-running this command with the --verbose flag may provide more information.npm ERR! code ELIFECYCLEnpm ERR! errno 1npm ERR! transatour@0.0.1 build:prod:ios: `cross-env NODE_OPTIONS='- -max-old-space-size=8192' ionic cordova build ios --prod --release`npm ERR! Exit status 1npm ERR! npm ERR! Failed at the transatour@0.0.1 build:prod:ios script.npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in:npm ERR! /Users/zakaria/.npm/_logs/2019-06-03T11_35_55_786Z- debug.log
在package.json配置文件中修改@ ionic / app-scripts版本并且把版本号前面的^符号去掉 表示不安装最新版只安装当前版本,prod打包只支持3.2.3版本
修改版本命令:
npm i @ionic/app-scripts@3.2.3
安装成功后再次npm install安装一下环境就可以了
评价