'ionic start myApp --v2' does not start


#1

Hi everyone,

Would appreciate if someone can give some guidance as to why ‘ionic start myApp --v2’ does not generate the app.
This is also suddenly the case for me with Ionic 1.

On my terminal I get the following:

/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/lib/start_wizard.js:94
      ps.stdout.on('data', (data) => {
                                  ^^
SyntaxError: Unexpected token =>
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:413:25)
    at Object.Module._extensions..js (module.js:448: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.start_wizard (/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/index.js:25:12)
    at Object.<anonymous> (/usr/local/lib/node_modules/ionic/lib/ionic/start.js:13:30)
    at Module._compile (module.js:430:26)


/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/lib/start_wizard.js:94
      ps.stdout.on('data', (data) => {
                                  ^^
Unexpected token => (CLI v2.2.1)

Your system information:

Cordova CLI: 6.5.0 
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
ios-deploy version: 1.7.0 
ios-sim version: 5.0.8 
OS: macOS Sierra
Node Version: v2.3.3
Xcode version: Xcode 8.2.1 Build version 8C1002

Thanks in advance


#2

I’d suggest updating your node version. You’re running 2.3.3.

From memory, Ionic2 requires a minimum of v5.something

The nvm tool is extremely useful for managing node versions: https://github.com/creationix/nvm

My dev environments are now all stably using v6.9.4 LTS.

My env:
Cordova CLI: 6.5.0
Ionic Framework Version: 2.0.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux xx
Node Version: v6.9.4


#3

I was not aware of that, updated and it works nicely.

Thanks a lot for your help!