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

时间:2018-02-09 02:38:14

标签: javascript android cordova visual-studio-2015 visual-studio-cordova

我有很多像这样的错误,所以我无法建立我的项目! 我正在使用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 ==========

1 个答案:

答案 0 :(得分:0)

此问题可能在regedit setting

OR

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

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