Ionic CLI error - Error: Cannot read property 'indexOf' of null on terminal


#1

im new to ionic and angular js. I was building my app succesfully using the ionic cli, now I am having an issue while building for ios which was working fine since yesterday. I have updated ionic, create new project but still cannot run this command “ionic build ios”, however “ionic serve” works successfully. Please note that I am using a mac and these command were working fine before. Grateful if someone can help me. Thanks.


#2

Hello!

Could you give us the follow info?

ionic -v:
cordova -v:
node -v:
npm -v:


#3

ionic -v: 1.7.14

cordova -v: 6.0.0

node -v: 5.7.0

npm -v: 3.6.0


#4

So if you’ve recently updated your node version, you might want to reinstall ionic-cli

npm install -g ionic@beta

We saw a few issues like this and they were all related to the cli needing to be reinstalled


#5

Still got the same problem after reinstall ionic-cli.

My current ionic-cli is 2.0.0-beta19


#6

1.7.14 got the same problem.


#7

@zhouhaowowtv whats you node/npm version?


#8

The problem is from the nodejs. Reinstall nodejs 5.7.1 solved the problem.


#9

thank you , it works now :grin:


#10

I’m facing this issue with this config:

Cordova CLI: 6.0.0
Ionic Version: 1.2.4
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
ios-deploy version: 1.8.5
ios-sim version: 5.0.6
OS: Mac OS X El Capitan
Node Version: v4.3.0

it just starts to happen without apparent reason. Updating the node version to 5.7.1 does not solved the problem.

EDITED: Something useful that i’ve found is that the trouble, in my case, is related to the presence of the iOS platform. Removing it makes the android composition works just fine again.