Ionic-cli: Cannot find module 'inherits'

Created on 23 Sep 2016  路  7Comments  路  Source: ionic-team/ionic-cli

Error: Cannot find module 'inherits'
at Function.Module._resolveFilename (module.js:440:15)
at Function.Module._load (module.js:388:25)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object. (C:UserskimliAppDataRoamingnpmnode_modulesionicnode_modulesglobglob.js:42:14)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)

old major version

Most helpful comment

I just had this issue when trying to start a new v2 project. Fixed it with:

npm uninstall ionic -g
npm install ionic -g

All 7 comments

Could you provide me with the output from ionic info from within your project directory? Thanks, this should help in troubleshooting.

I just had this issue when trying to start a new v2 project. Fixed it with:

npm uninstall ionic -g
npm install ionic -g

@jthoms1

 ionic info
Caught exception:
 Error: Cannot find module 'inherits'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Module.require (module.js:468: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:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3) 

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

This is my output I'm trying to update since I was still on Angular2 RC 4

That is interesting @btsiders 's solution seems to work for me as well.

Was not expecting so!

I'm having the same problem but with module 'extend'.
I tried @btsiders 's solution but it did not work

  • ionic info:
    Caught exception:
    Error: Cannot find module 'extend'
    at Function.Module._resolveFilename (module.js:326:15)
    at Function.Module._load (module.js:277:25)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object. (/usr/local/lib/node_modules/ionic/node_modules/request/index.js:17:29)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)

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

Hello,

having the same problem, same error.
tried uninstall/install cordova and ionic -g, nothing helps... can't do ionic info

stuck with the first project.

$ node --version
v6.10.1
$ nvm --version
0.33.1
$ cordova --version
6.5.0
$ uname -v
Darwin Kernel Version 16.4.0: Thu Dec 22 22:53:21 PST 2016; root:xnu-3789.41.3~3/RELEASE_X86_64
(= OSX 10.12.3)

Johan.

Thanks for the issue! This issue appears to be associated with an old version of the Ionic CLI. Please update to the latest CLI version, which supports all versions of the Ionic Framework. If the issue is relevant and if it persists after updating to the latest CLI version, please create a new issue.

Thank you for using Ionic!

Was this page helpful?
0 / 5 - 0 ratings