Updating Ionic and cordova not working


I have tried updating Ionic and Cordova using npm install -g cordova ionic

The install seems to work but now any Ionic command I run gives me this error

        const [xcode, iosDeploy, iosSim,] = yield Promise.all([

SyntaxError: Unexpected token [
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:414:25)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (C:\Users\Phil\AppData\Roaming\npm\node_modules\ionic\bin\ionic:8:11)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)

I have tried updating npm and I am on 4.6.1 and tried reinstalling both again but still receive the error when I type any ionic command. Example ionic info

I’m on windows.


What version of nodejs itself do you have?


I should have included that, it’s 4.2.1


@rapropos Yeah, you’re right - it was my nodejs version not npm version that was the issue. Thanks

Updating to nodejs v6.10.3 solved the issue