Ionic-cli: Cannot read property 'slice' of undefined

Created on 2 Jun 2016  路  13Comments  路  Source: ionic-team/ionic-cli

Hi,

i just try ionic v2 installing, when run ionic platform add android or ionic plugin add cordova-plugin-inappbrowser

throws

 TypeError: Cannot read property 'slice' of undefined
    at Object.run (/usr/local/lib/node_modules/ionic/lib/ionic/platform.js:35:32)
    at Promise.apply (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:1078:26)
    at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:741:41)
    at /usr/local/lib/node_modules/ionic/node_modules/q/q.js:1304:14
    at flush (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:108:17)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
    at Function.Module.runMain (module.js:577:11)
    at startup (node.js:160:18)
    at node.js:449:3 

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

ionic version: 2.0.0-beta.26
cordova: 6.2.0

thanks

Most helpful comment

same problem here!
npm i -g [email protected] to downgrade for now.

All 13 comments

I got the same problem.馃槀
When i run ionic platform add ios,
the TypeError: Cannot read property 'slice' of undefined showed.

Me too,

Caught exception:
TypeError: Cannot read property 'slice' of undefined
at Object.run (/usr/local/lib/node_modules/ionic/lib/ionic/run.js:44:32)
at Promise.apply (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:1078:26)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:741:41)
at /usr/local/lib/node_modules/ionic/node_modules/q/q.js:1304:14
at flush (/usr/local/lib/node_modules/ionic/node_modules/q/q.js:108:17)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)

Cordova CLI: 6.2.0
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.7
Ionic CLI Version: 2.0.0-beta.26
Ionic App Lib Version: 2.0.0-beta.16
ios-deploy version: 1.8.5
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v5.11.1
Xcode version: Xcode 7.3.1 Build version 7D1014

I think this is a Beta26 issue as it only started after I updated to beta26. On my other machine which hasn't been updated it's working fine.

same problem here!
npm i -g [email protected] to downgrade for now.

Same here! This seems to be a major problem. Even the build command has this error.
Seems like the 'rawCliArguments' is not passed to the method 'run' calls and the scripts try to to a 'slice' on 'undefined'.

hello everyone!
did someone find the solution for this? i am also getting the same error.

As said @onkelfredrik if you downgrade your version of ionic it's works ( it works for me in any case), so try this:
npm i -g [email protected]

I am working on a fix for this and should have it out in a few hours. Thanks for reporting.

In the meantime you can downgrade to beta.25. npm i -g [email protected]

@jthoms1 can you update here when the fix is out. Also where can we find the changelog for ionic-cli?

I will post an update here. The beta work is currently done in the v2 branch. https://github.com/driftyco/ionic-cli/blob/v2/CHANGELOG.md

Commit 5549b828c87b2ea5cf29ccb1c562d519bb6ee1b5 fixes this issue.

beta.27 is now on NPM. You can update by installing from beta tag. npm i -g ionic@beta

Thanks for your patience!

Thanks @jthoms1

Thanks @jthoms1

Was this page helpful?
0 / 5 - 0 ratings