Not able to build or emulate iOS due to TypeError: Cannot read property 'then' of undefined


#1

I can’t seem to be able to build or emulate ios. I am getting some typescript errors (currently trying out ionic 2 beta), not shown, but I get those running ionic serve -l and it runs fine, so do I need to worry about them?

It seems to be these TypeErrors (TypeError: Cannot read property ‘then’ of undefined) below that don’t change for build or emulate ios or allow either to work.


#2

Nevermind, doing this – sudo npm install -g cordova again seemed to fix it although I am now having trouble in the simulator itself with showing the app.


#3

I think it’s a mistake to run npm as root.


#4

Thanks, so how should I fix it rerun it without sudo?


#5

I use nvm. It allows multiple versions of node to all be installed in a user’s home directory.