MSBuild错误:读取构建配置文件导致cordova-build错误:TypeError:undefined不是函数-Android

时间:2018-03-21 13:31:28

标签: visual-studio-cordova

我在通过visual studio-2015执行Apache cordova构建时遇到了这个问题,我得到以下错误。

  • VS2015;
  • npm -v - 5.7.1
  • 节点-v 8.8.0
  • Cordova tools 6.5.0
  • 使用cordova-android@6.4.0
  • 创建的Android项目

最后几行错误记录

>  Prepared android project successfully
>  No scripts found for hook "after_prepare".
>  Checking config.xml for saved plugins that haven't been added to the project
>  ------ Copied C:\Project\Mobile\bin\Android\Debug\VSBuildInfo.xml to platforms\android\assets\www\VSBuildInfo.xml
>  ------ Building platform: android
>  Debug
>  ------ Build configuration options: --debug
>  No scripts found for hook "before_compile".
>  ANDROID_HOME=C:\Users\<username>\AppData\Local\Android\sdk
>  JAVA_HOME=C:\Program Files\Java\jdk1.8.0_144
>  Reading build config file: C:\Project\Mobile\build.json
> MSBUILD : cordova-build error : TypeError: undefined is not a function
>  TypeError undefined is not a function

感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

我认为是与节点版本相关的问题。

尝试使用 VS Cordova工具 Cordova 的最新版本进行构建后,我已经在最新节点版本上加入了一些问题。

尝试将节点降级为节点4.8.7 LTS

https://nodejs.org/en/blog/release/v4.8.7/