简体   繁体   English

运行“ ionic cordova build android”命令时,如何解决无效或意外的令牌问题?

[英]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. 我正在尝试生成离子应用程序的APK。 ionic serve render without errors, but when i run ionic cordova build android it give me this error : 离子服务渲染没有错误,但是当我运行ionic cordova build android它给了我这个错误:

i've already try to uninstall then install cordova without results. 我已经尝试卸载然后安装cordova而没有结果。

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. 取消安装然后安装ionic和cordova即可解决此问题。 It was caused by some missing dependancies in cordova and ionic package due to poor internet connexion. 这是由于互联网连接不佳导致科尔多瓦和离子包装缺少一些依赖关系所致。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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