Ionic is [undefined:0] and won't run


#1

Running Ionic on Yosemite here. I was running the beta perfectly fine for a few months, but now running any Ionic command returns:

$ ionic info
undefined:0

^
SyntaxError: Unexpected end of input
    at Object.parse (native)
    at Object.module.exports.load (/usr/local/lib/node_modules/ionic/lib/ionic/config.js:12:24)
    at Object.<anonymous> (/usr/local/lib/node_modules/ionic/lib/ionic/stats.js:517:31)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478: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> (/usr/local/lib/node_modules/ionic/lib/ionic/info.js:8:18)

I’ve tried uninstalling node, npm, and reinstalling ionic multiple different ways. I can’t trace what caused this problem to begin—any thoughts?


Ionic command not work
#2

Posted fix here:


#3

Good catch! Was the config changed because you did something or because of an external module such as node or whatever?

I ask because if it was changed externally, this could end up being a problem for more than a few people using Linux or Mac OS.

~ Brad