Ionic-cli: Installing Ionic error: Cannot find module 'inherits'

Created on 17 Sep 2016  路  6Comments  路  Source: ionic-team/ionic-cli

Hi, I've just been trying to install Ionic 2 (as I was originally trying to update to the latest beta). Now I keep getting this error:
Caught exception: Error: Cannot find module 'inherits' at Function.Module._resolveFilename (module.js:455:15) at Function.Module._load (module.js:403:25) at Module.require (module.js:483:17) at require (internal/module.js:20:19) at Object.<anonymous> (/usr/local/lib/node_modules/ionic/node_modules/glob/glob.js:42:14) at Module._compile (module.js:556:32) at Object.Module._extensions..js (module.js:565:10) at Module.load (module.js:473:32) at tryModuleLoad (module.js:432:12) at Function.Module._load (module.js:424:3)

I've tried option 1 of the how to fix npm permissions problems from the npm site (https://docs.npmjs.com/getting-started/fixing-npm-permissions). But still the error keeps on happening.

Most helpful comment

This could help:

npm uninstall -g ionic cordova
npm install -g ionic cordova

Fix permissions too: https://docs.npmjs.com/getting-started/fixing-npm-permissions
Sometimes cordova is not present!

All 6 comments

Hello, thanks for opening an issue with us! Would you mind posting the command you used to try to install the cli? Thanks!

I used npm install -g ionic I also tried with sudo

This could help:

npm uninstall -g ionic cordova
npm install -g ionic cordova

Fix permissions too: https://docs.npmjs.com/getting-started/fixing-npm-permissions
Sometimes cordova is not present!

I actually found out what the problem was, I have a newer version of Node running, not the LTS version. So I had to remove Node and npm, then install nvm to have both the LTS version and a latest version (which I need for a workshop I'm attending).
So now everything is working (as long as I remember which version I'm running on).

@calebeaires I'm using mac and pls let me know what to do for the same issue!

@calebeaires Thanks a lot It helps me. First we have to uninstall completely then install again.

Was this page helpful?
0 / 5 - 0 ratings