Android 的 Cordova 构建错误所以我无法构建我的解决方案

Cordova build Error for Android So i can't build my solution

我遇到了很多这样的错误,所以我无法构建我的项目! 我正在使用 visual studio 2015。 这个错误是什么意思? 我该如何解决这个问题?

enter image description here

1>  ------ Version from source package.json: 1.0.42
1>  ------ Package already installed globally at correct version.
1>  ------ Cordova tools 8.0.0 already installed.
1>MSBUILD : cordova-build error : C:\Users\Anna\AppData\Roaming\npm\node_modules\cordova\node_modules\json-parse-better-errors\index.js:9
1>  C:\Users\Anna\AppData\Roaming\npm\node_modules\cordova\node_modules\json-parse-better-errors\index.js:9
1>MSBUILD : cordova-build error :  const syntaxErr = e.message.match(/^Unexpected token.*position\s+(\d+)/i)
1>      const syntaxErr = e.message.match(/^Unexpected token.*position\s+(\d+)/i)
1>MSBUILD : cordova-build error :  ^^^^^
1>      ^^^^^
1>MSBUILD : cordova-build error : SyntaxError: Use of const in strict mode.
1>  SyntaxError Use of const in strict mode.
1>MSBUILD : cordova-build error :  at exports.runInThisContext (vm.js:73:16)
1>      at exports.runInThisContext (vm.js:73:16)
1>MSBUILD : cordova-build error :  at Module._compile (module.js:443:25)
1>      at Module._compile (module.js:443:25)
1>MSBUILD : cordova-build error :  at Object.Module._extensions..js (module.js:478:10)
1>      at Object.Module._extensions..js (module.js:478:10)
1>MSBUILD : cordova-build error :  at Module.load (module.js:355:32)
1>      at Module.load (module.js:355:32)
1>MSBUILD : cordova-build error :  at Function.Module._load (module.js:310:12)
1>      at Function.Module._load (module.js:310:12)
1>MSBUILD : cordova-build error :  at Module.require (module.js:365:17)
1>      at Module.require (module.js:365:17)
1>MSBUILD : cordova-build error :  at require (module.js:384:17)
1>      at require (module.js:384:17)
1>MSBUILD : cordova-build error :  at Object.<anonymous> (C:\Users\Anna\AppData\Roaming\npm\node_modules\cordova\node_modules\read-package-json\read-json.js:12:16)
1>      at Object.<anonymous> (C:\Users\Anna\AppData\Roaming\npm\node_modules\cordova\node_modules\read-package-json\read-json.js:12:16)
1>MSBUILD : cordova-build error :  at Module._compile (module.js:460:26)
1>      at Module._compile (module.js:460:26)
1>MSBUILD : cordova-build error :  at Object.Module._extensions..js (module.js:478:10)
1>      at Object.Module._extensions..js (module.js:478:10)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========

这个问题可能在 regedit setting

您正在尝试将 program file/android/folders 移动到 appdata/android/folders

我通过重新安装 android studio 并重置与 cordova 相关的系统路径解决了这个问题。