Ionic serve not working after npm install


#1

Hi community,
I just deleted node directory and then added it with, npm install.
After that ionic serve giving the following error:

Error: Cannot find module 'reflect-metadata’
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (F:\ionic\Gemeinde\Kilchberg\node_modules@ionic\app-scripts\dist\aot\aot-compiler.js:5:1)
at Module._compile (module.js:570:32)
at Object.Module._extensions…js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)

Can,t able to build either.Anyone have any idea about this.

Any suggestion is appreciable.

Thanks,


#2

What is your ionic info output?
Do you always get the same error?
What does npm list -g --depth=0 return?


#3

hi @Sujan12,
Thanks for reply.
My ionic info:

@ionic/cli-utils  : 1.15.1
ionic (Ionic CLI) : 3.15.1

global packages:

cordova (Cordova CLI) : 7.1.0

local packages:

@ionic/app-scripts : 1.3.7
Cordova Platforms  : android 6.2.3 ios 4.5.2
Ionic Framework    : ionic-angular 3.2.0

System:

Node : v6.10.0
npm  : 5.5.1
OS   : Windows 10

and npm list -g --depth=0 returns =>
±- add-cors-to-couchdb@0.0.6
±- bower@1.8.0
±- cordova@7.1.0
±- ionic@3.15.1
`-- npm@5.5.1

And I always get this error.
Thanks,


#4

This is super old, you should upgrade this.


#5

hi @Sujan12,
Is this is making the issue.


#6

Possible, probably. No way to say for sure. But new versions are released as the fix problems. So not updating can cause problems.