Ionic serve => cannot find module "reflect-metadata"


#1

i have just started with ionic 2 .

$ npm install -g ionic cordova
$ ionic start cutePuppyPics --v2
$ cd cutePuppyPics
$ ionic serve
and then an error appear :
cannot find module 'reflect-metadata'
$ ionic info
ordova CLI: 6.5.0
Ionic Framework Version: 2.2.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 1.1.4
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 8.1
Node Version: v7.7.2
Xcode version: Not installed
i try also
npm update -g , but not work
npm -v : 2.15.11 ionic -v 2.2.1


#2

Did you try

npm install

?


#3

yes i tried with same error:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules@i
onic\app-scripts\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.1.1: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”}


#4

there’s already an issue on this at github, no solution so far.
(i’m having the same issue)


#5

i find this solution
in the Ionic Project, open:

package.json
Add this in it:

“reflect-metadata”: “^0.1.3”,
Then run this on console: npm install

and Then run this: npm rebuild or npm rebuild node-sass

Ready to run ionic serve to see your app :wink:


#6

Found a fix for it: (but forgot to press post apparently)

  • Open your project folder
  • Open Package.json and add “reflect-metadata”: “^0.1.3”,
  • run npm install on the folder

–> ionic is no longer adding reflect-metadata to the package.json


#7

Hello,

I have tried all the above solutions but I’m still getting the same error.
inonic info

[ERROR] Error with ./node_modules/ionic-angular/package.json file: FILE_NOT_FOUND

global packages:

@ionic/cli-utils : 1.4.0
Ionic CLI        : 3.4.0

local packages:

@ionic/app-scripts              : 1.3.11
@ionic/cli-plugin-ionic-angular : 1.3.1
Ionic Framework                 : not installed

System:

Node       : v8.1.2
OS         : Linux 4.2
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed
npm        : 5.0.3

#8

Just an FYI, I’m getting this today as well.


#9

I also got same error too.


#10

Same error here today.
Yesterday there were no issues with everything exactly the same (before the dependencies update from “ionic-angular”: “3.4.2” to “ionic-angular”: “3.5.0” in ionic2-app-base/package.json).


#11

Same error here, any solution yet


#12

Same error here. Suggested solution not working.


#13

This solved my problem:

ionic start SomeProjectName blank --type=ionic-angular

Note “–type=ionic-angular”

ionic serve now works.


#14

Thanks @robertlove I fixed this issue by maually intalling reflect-metadata

use- npm install reflect-metadata

  • npm rebuild
  • ionic serve

#15

This worked. Thank you @robertlove


#16

I did that too, however in my case, I got another missing dependencies Error: Cannot find module ‘@angular/tsc-wrapped/src/tsc’

ionic 3.4.0
npm 5.0.4
node 6.11.0


#17

There was another @ionic/app-scripts release that hopefully fixes that. Could you start a new project with ionic start blank blank and see if you can ionic serve that without problems?

If you still get an error, please post your ionic info output of that project then.