3

I'm trying to run ionic in terminal and am getting the following error:

module.js:487
    throw err;
    ^

Error: Cannot find module '@ionic/cli-utils'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/ionic/dist/index.js:14:21)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)

I've looked around on google but can't find any reason for the error. Any ideas?

1
  • You can just delete the node_modules folder and do some npm install again this should fix the issue. Commented Aug 16, 2017 at 3:41

3 Answers 3

3

It also happened to me when updating new version. Solved It as:

  1. Delete node_modules
  2. Delete package-lock.json file
  3. Run npm install command
  4. ionic serve
Sign up to request clarification or add additional context in comments.

Comments

2

Happened to me when updating Ionic to it's latest version (currently 3.9.2). Solved it doing the following:

  • Delete package-lock.json file
  • Delete node_modules/ folder
  • Edit package.json file dependencies and devDependencies sections to:

    "dependencies": {
        "@angular/common": "4.1.3",
        "@angular/compiler": "4.1.3",
        "@angular/compiler-cli": "4.1.3",
        "@angular/core": "4.1.3",
        "@angular/forms": "4.1.3",
        "@angular/http": "4.1.3",
        "@angular/platform-browser": "4.1.3",
        "@angular/platform-browser-dynamic": "4.1.3",
        "@ionic-native/core": "3.12.1",
        "@ionic-native/splash-screen": "3.12.1",
        "@ionic-native/status-bar": "3.12.1",
        "@ionic/storage": "2.0.1",
        "ionic-angular": "3.6.0",
        "ionicons": "3.0.0",
        "rxjs": "5.4.0",
        "sw-toolbox": "3.6.0",
        "zone.js": "0.8.12"      
    },
    "devDependencies": {
        "@ionic/app-scripts": "2.1.3",
        "typescript": "2.3.4"
    }
    
  • Run npm install again
  • Edit script section in the www/index.html file:

    <script src="build/polyfills.js"></script>
    <script src="build/vendor.js"></script>
    <script src="build/main.js"></script>
    

Comments

0

what is your ionic's version? please type some ionic info if is ionic3.x try npm i -g @ionic/cli-utils? i solved it,

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.