SyntaxError: Unexpected token [- ionic

I am trying to start my first ionic application; getting 'SyntaxError: Unexpected token [' on all ion commands. Literally all ion commands return the same output.

$ ionic start test --v2

/Users/user/.nvm/versions/node/v4.1.1/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:413:25)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/Users/user/.nvm/versions/node/v4.1.1/lib/node_modules/ionic/bin/ionic:8:11)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)

NPM: 4.5.0

OS: OSX Sierra

+6
source share
2 answers

The solution should not go down as suggested by the previously accepted answer, but update Node as suggested in this answer .

Ionic should work on Node> 6.

So, I decided to update it Node on my Mac using Brew, for example:

brew upgrade node
brew link --overwrite node

Node was first updated. The second was needed to overwrite the other Node binaries that I had.

Node 7, .

+4

, TypeScript ( Ionic 3.0.0 ). , npm uninstall -g ionic npm install -g ionic@2.2.3.

, !

+6

Source: https://habr.com/ru/post/1017226/


All Articles