ionic serve not executing

444 Views Asked by At

I have this simple app.

I am getting this error while running ionic serve command:

Error: Cannot find module 

    '/media/sae/work/linuxspace/techieApp/node_modules/@ionic/app-scripts'
        at Function.Module._resolveFilename (module.js:542:15)
        at Function.Module._load (module.js:472:25)
        at Module.require (module.js:585:17)
        at require (internal/module.js:11:18)
        at Object.<anonymous> (/usr/local/lib/node_modules/ionic/node_modules/@ionic/cli-utils/lib/ionic-angular/app-scripts.js:9:16)
        at Generator.next (<anonymous>)
        at /usr/local/lib/node_modules/ionic/node_modules/tslib/tslib.js:103:75
        at new Promise (<anonymous>)
        at Object.__awaiter (/usr/local/lib/node_modules/ionic/node_modules/tslib/tslib.js:99:16)
        at Object.importAppScripts (/usr/local/lib/node_modules/ionic/node_modules/@ionic/cli-utils/lib/ionic-angular/app-scripts.js:7:20)

This link suggests downgrading my node.js.

https://stackoverflow.com/questions/46021115/cannot-find-module-node-modules-ionic-app-scripts-ionic-3

I do not want to downgrade my node.js.

Can someone guide me what to do here?

1

There are 1 best solutions below

2
On

Here you have all versions of Node.js https://nodejs.org/en/download/releases/ Just download the version you want & install it.

from npm docs:

An easy way to stay up-to-date

Node.js has lots of versions, and its development is very active. As a good practice to manage the various versions, we recommend that you use a version manager for your Node.js installation. There are many great options, here are a few:

  • NVM
  • nodist
  • n
  • nave
  • nodebrew