" ionic cordova build android --prod --release"问题



我已经使用ionic2创建了聊天应用程序。当我尝试使用ionic cordova build android --prod --release进行生产构建时,我会遇到以下错误。

    Error: ./node_modules/rxjs/observable/BoundCallbackObservable.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Object.getEffectiveTypeAnnotationNode (C:UserscoolDesktopChatSideMenunode_modulestypescriptlibtypescript.js:9341:17)
    at assignContextualParameterTypes (C:UserscoolDesktopChatSideMenunode_modulestypescriptlibtypescript.js:41652:25)
    at checkFunctionExpressionOrObjectLiteralMethod (C:UserscoolDesktopChatSideMenunode_modulestypescriptlibtypescript.js:41948:29)
    at checkExpressionWorker (C:UserscoolDesktopChatSideMenunode_modulestypescriptlibtypescript.js:42959:28)
    at checkExpression (C:UserscoolDesktopChatSideMenunode_modulestypescriptlibtypescript.js:42898:42)
    at checkExpressionCached (C:UserscoolDesktopChatSideMenunode_modulestypescriptlibtypescript.js:42779:38)
    at checkReturnStatement (C:UserscoolDesktopChatSideMenunode_modulestypescriptlibtypescript.js:45418:54)
    at checkSourceElement (C:UserscoolDesktopChatSideMenunode_modulestypescriptlibtypescript.js:46763:28)
    at Object.forEach (C:UserscoolDesktopChatSideMenunode_modulestypescriptlibtypescript.js:1506:30)
    at checkBlock (C:UserscoolDesktopChatSideMenunode_modulestypescriptlibtypescript.js:44563:16)
 @ ./node_modules/rxjs/observable/bindCallback.js 2:32-68
 @ ./node_modules/rxjs/add/observable/bindCallback.js
 @ ./node_modules/rxjs/Rx.js
 @ ./src/providers/apis/apis.ts
 @ ./src/app/app.module.ngfactory.js
 @ ./src/app/main.ts,./node_modules/rxjs/observable/BoundNodeCallbackObservable.js
Module build failed: TypeError: Cannot read property 'type' of undefined
    at Object.getEffectiveTypeAnnotationNode (C:UserscoolDesktopChatSideMenunode_modulestypescriptlibtypescript.js:9341:17)
    at assignContextualParameterTypes (C:UserscoolDesktopChatSideMenunode_modulestypescriptlibtypescript.js:41652:25)
    at checkFunctionExpressionOrObjectLiteralMethod (C:UserscoolDesktopChatSideMenunode_modulestypescriptlibtypescript.js:41948:29)
    at checkExpressionWorker (C:UserscoolDesktopChatSideMenunode_modulestypescriptlibtypescript.js:42959:28)
    at checkExpression (C:UserscoolDesktopChatSideMenunode_modulestypescriptlibtypescript.js:42898:42)
    at checkExpressionCached (C:UserscoolDesktopChatSideMenunode_modulestypescriptlibtypescript.js:42779:38)
    at checkReturnStatement (C:UserscoolDesktopChatSideMenunode_modulestypescriptlibtypescript.js:45418:54)
    at checkSourceElement (C:UserscoolDesktopChatSideMenunode_modulestypescriptlibtypescript.js:46763:28)
    at Object.forEach (C:UserscoolDesktopChatSideMenunode_modulestypescriptlibtypescript.js:1506:30)
    at checkBlock (C:UserscoolDesktopChatSideMenunode_modulestypescriptlibtypescript.js:44563:16)
 @ ./node_modules/rxjs/observable/bindNodeCallback.js 2:36-76
 @ ./node_modules/rxjs/add/observable/bindNodeCallback.js
 @ ./node_modules/rxjs/Rx.js
 @ ./src/providers/apis/apis.ts
 @ ./src/app/app.module.ngfactory.js
 @ ./src/app/main.ts
    at BuildError.Error (native)
    at new BuildError (C:UserscoolDesktopChatSideMenunode_modules@ionicapp-scriptsdistutilerrors.js:16:28)
    at callback (C:UserscoolDesktopChatSideMenunode_modules@ionicapp-scriptsdistwebpack.js:121:28)
    at emitRecords.err (C:UserscoolDesktopChatSideMenunode_moduleswebpacklibCompiler.js:269:13)
at Compiler.emitRecords (C:UserscoolDesktopChatSideMenunode_moduleswebpacklibCompiler.js:375:38)
    at emitAssets.err (C:UserscoolDesktopChatSideMenunode_moduleswebpacklibCompiler.js:262:10)
    at applyPluginsAsyncSeries1.err (C:UserscoolDesktopChatSideMenunode_moduleswebpacklibCompiler.js:368:12)
    at next (C:UserscoolDesktopChatSideMenunode_modulestapablelibTapable.js:218:11)
    at Compiler.compiler.plugin (C:UserscoolDesktopChatSideMenunode_moduleswebpacklibperformanceSizeLimitsPlugin.js:99:4)
    at Compiler.applyPluginsAsyncSeries1 (C:UserscoolDesktopChatSideMenunode_modulestapablelibTapable.js:222:13)

离子信息

cli packages: (C:UserscoolAppDataRoamingnpmnode_modules)
@ionic/cli-utils  : 1.19.0
ionic (Ionic CLI) : 3.19.0

全局软件包:

cordova (Cordova CLI) : 7.1.0

本地软件包:

@ionic/app-scripts : 3.1.0
Cordova Platforms  : android 6.3.0
Ionic Framework    : ionic-angular 3.9.2

系统:

Android SDK Tools : 26.1.1
Node              : v6.10.3
npm               : 3.10.10
OS                : Windows 8.1

请帮助我解决此错误。我看过一些类似的问题,但没有任何帮助我解决这个问题。

尝试 @und3rtow提到的文档中指定的以下步骤

npm install typescript@latest

相关内容

  • 没有找到相关文章

最新更新