带有AngularJS的离子-SyntaxError:意外令牌[ [英] Ionic with AngularJS - SyntaxError: Unexpected token [

查看:81
本文介绍了带有AngularJS的离子-SyntaxError:意外令牌[的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试遵循本教程:

I'm trying to follow this tutorial:

,当我键入ionic -v或只是ionic时,它给了我这个错误:

and when I type ionic -v or just ionic it is giving me this error:

AppData\Roaming\npm\node_modules\ionic\dist\index.js:24
        const [xcode, iosDeploy, iosSim,] = yield Promise.all([
              ^

Io
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (\AppData\Roaming\npm\node_modules\ionic\bin\ionic:8:11)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)

我已经在全球安装了cordova和ionic:npm install cordova ionic -g和本地安装,但结果相同.我也做了npm init.

I have installed cordova and ionic globally: npm install cordova ionic -g and locally, but same outcome. I have also done npm init.

这是什么原因?

谢谢.

推荐答案

看看这个github问题:

Take a look at this github issue: https://github.com/driftyco/ionic/issues/11588

这是安装后出现的离子问题

较新版本的ionic似乎是一个问题.升级NodeJs版本应该可以解决问题.

It looks to be an issue with the newer version of ionic. Upgrading your NodeJs version should do the trick.

您必须更新NodeJS. CLI 3需要> = 6.x

You have to update NodeJS. CLI 3 needs >= 6.x

这篇关于带有AngularJS的离子-SyntaxError:意外令牌[的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆