3

Im on osx. I had a development with node, npm and ionic. Everything worked. I accidentally run this command:

npm install -g ionic 

After that Ionic is not working anymore. if I try to create a project or start an existing one I got 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) Mind letting us know? https://github.com/driftyco/ionic-cli/issues 

npm -v gives:

3.10.8 

node -v gives:

v6.4.0 

ionic -v gives the same error message as above. Im not sure if I installed node/npm with brew or what else. Any ideas?

3
  • Have you tried re-installing? Commented Sep 21, 2016 at 9:23
  • If I try npm uninstall cordova ionic (both with and without sudo) it fails. it prints: enoent ENOENT: no such file or directory, open '/Users/suername/package.json'. And then other error messages related to angular 1, like this: enoent ENOENT: no such file or directory, open '/Users/suername/package.json' Commented Sep 21, 2016 at 9:30
  • I'll suggest using the commands in my answer below first. I.e. remove and purge your npm/npm modules, re-install npm then try reinstalling ionic again. Cheers Commented Sep 21, 2016 at 9:32

3 Answers 3

4

in my case , uninstalling and reinstalling the ionic worked .

1.npm uninstall -g ionic cordova

2.npm install -g ionic cordova

3.npm update minimatch

4.try reinstalling ionic using ionic@latest

Sign up to request clarification or add additional context in comments.

Comments

0

This is because the module 'inherits' is missing which may be a problem with npm.

I'll simply suggest uninstalling and installing again as you may have downloaded corrupt/incomplete files.

On MacOS/Unix:

brew uninstall npm sudo rm -rf /usr/lib/node_modules/ brew install npm 

Then retry installing ionic

npm uninstall -g ionic npm install -g ionic

2 Comments

I run the comands. After last ocmmand I get this: Error: Cannot find module 'are-we-there-yet'. Sigh.
Try: npm i npm -g
0

Try again by adding “read and write” permission to your project root folder

Like

Ionic is my project root folder and under the ionic folder i have a app named ionicapp

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.