简体   繁体   中英

How to fix Invalid or unexpected token issue when running “ionic cordova build android” command?

I am trying to generate an APK of my ionic applications. ionic serve render without errors, but when i run ionic cordova build android it give me this error :

i've already try to uninstall then install cordova without results.

C:\Users\Nacim\AppData\Roaming\npm\node_modules\cordova\node_modules\currently-unhandled\core.js:1
(function (exports, require, module, __filename, __dirname) {


SyntaxError: Invalid or unexpected token
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:617:28)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\Nacim\AppData\Roaming\npm\node_modules\cordova\node_modules\currently-unhandled\index.js:2:12)
[ERROR] An error occurred while running subprocess cordova.

    cordova build android --verbose exited with exit code 1.

Any idea of the root of the issue ?

Uninstaling then instaling ionic and cordova resolve the issue. It was caused by some missing dependancies in cordova and ionic package due to poor internet connexion.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM