Ionic-framework: Ionic command fails after update

Created on 9 May 2017  路  13Comments  路  Source: ionic-team/ionic-framework

Ionic version: (check one with "x")
[ ] 1.x
[ ] 2.x
[ x] 3.x

I'm submitting a ... (check one with "x")
[ x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:
When I run ionic info I get:

/usr/local/lib/node_modules/ionic/dist/index.js:24
        const [xcode, iosDeploy, iosSim,] = yield Promise.all([
              ^

SyntaxError: Unexpected token [
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/ionic/bin/ionic:8:11)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)

Expected behavior:
I should get the version information of ionic

Steps to reproduce:
I install cordova and ionic:

sudo npm install -g cordova
sudo npm install -g ionic

And run:

ionic info

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):
The command fails

Other information:
Here there is a StackOverflow question with the same issue:
http://stackoverflow.com/questions/43879265/ionic-issue-after-installation

Most helpful comment

updating nodejs solved it for
sudo n latest

All 13 comments

+1

+1

+1

+1

It should work if I'd specify an older version, right?

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

also downgrading ionic works - npm install -g [email protected] - but this should not be considered an option

[ERROR] Error occurred while loading plugins. CLI functionality may be limited.
Checking for CLI updates now...
[ERROR] No updates found after plugin error--please report this issue.

global packages:

@ionic/cli-utils : 1.0.0
Ionic CLI        : 3.0.0

System:

Node       : v6.9.1
OS         : Windows 10
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed

+1

updating nodejs solved it for
sudo n latest

Thanks @Borongaj !

Since I'm running CI on a remote agent on which I don't have sudo access then I had to stick to specifying the ionic version. +1 for the version tip @mrommel ! ;)

Try removing the node_modules directory and run npm install again. If this fails try installing the ionic again.

This issue was moved to driftyco/ionic-cli#2250

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

Was this page helpful?
0 / 5 - 0 ratings