# Error with ionic2

**URL:** <https://forum.ionicframework.com/t/error-with-ionic2/83711>\
**Category:** ionic-v3\
**Created:** [March 21, 2017, 9:38pm UTC](https://forum.ionicframework.com/t/error-with-ionic2/83711 "2017-03-21T21:38:58Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![narjes](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@narjes](https://forum.ionicframework.com/u/narjes)\
**Post date:** [March 21, 2017, 9:38pm UTC](https://forum.ionicframework.com/t/error-with-ionic2/83711/1 "2017-03-21T21:38:58Z")

</div>

Hi all,  
i have worked with ionic1 last year,but now when i try to developp with ionic2: i updated the new version of ionic,cordova …when i start new project (tabs) with --v2 : and try to execute it with “ionic serve” i have that errors :

 ![image](https://global.discourse-cdn.com/ionicframework/original/3X/5/a/5a979e019cb98d2884ab5caecf29a869a746ad4c.PNG)  
and i tried to install npm ,i got that : ![image](https://global.discourse-cdn.com/ionicframework/original/3X/0/a/0a535843db3ad05015bc28e3c2ad129deb3b9a75.PNG)  
pleaase any help ☹

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [March 21, 2017, 9:43pm UTC](https://forum.ionicframework.com/t/error-with-ionic2/83711/2 "2017-03-21T21:43:58Z")

</div>

You could try searching the forums for similar error messages. I, however, can’t, because you didn’t bother to post them as text.

---

<div class="post-metadata">

**Author:** ![narjes](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@narjes](https://forum.ionicframework.com/u/narjes)\
**Post date:** [March 21, 2017, 9:48pm UTC](https://forum.ionicframework.com/t/error-with-ionic2/83711/3 "2017-03-21T21:48:36Z")

</div>

i searched here i didn’ find similar errors .  
for the post ,normally picture shwoing errors explains more than text !

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [March 21, 2017, 9:54pm UTC](https://forum.ionicframework.com/t/error-with-ionic2/83711/4 "2017-03-21T21:54:16Z")

</div>

> [@narjes](#):
>
> normally picture shwoing errors explains more than text

I and [the entirety of StackOverflow](https://meta.stackoverflow.com/questions/303812/discourage-screenshots-of-code-and-or-errors) disagree very strenuously with you about that for a myriad of reasons.

---

<div class="post-metadata">

**Author:** ![narjes](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@narjes](https://forum.ionicframework.com/u/narjes)\
**Post date:** [March 21, 2017, 9:57pm UTC](https://forum.ionicframework.com/t/error-with-ionic2/83711/5 "2017-03-21T21:57:45Z")

</div>

why ? so if y can’t help me ,that’s alright !  
please, im waiting another one who can help me to resolve that

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [March 21, 2017, 9:59pm UTC](https://forum.ionicframework.com/t/error-with-ionic2/83711/6 "2017-03-21T21:59:46Z")

</div>

> [@narjes](#):
>
> im waiting another one who can help me to resolve that

While you’re waiting, why don’t you edit your first page to have code instead of screenshots?

---

<div class="post-metadata">

**Author:** ![narjes](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@narjes](https://forum.ionicframework.com/u/narjes)\
**Post date:** [March 21, 2017, 10:02pm UTC](https://forum.ionicframework.com/t/error-with-ionic2/83711/7 "2017-03-21T22:02:04Z")

</div>

because i closed the cmd page ,i have only the screenshots now ? what’s the problem with pictures ! y can’t understand the source of problem and how to resolve it ?? i can’t understand whay that “npm errors” ☹

---

<div class="post-metadata">

**Author:** ![narjes](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@narjes](https://forum.ionicframework.com/u/narjes)\
**Post date:** [March 21, 2017, 10:15pm UTC](https://forum.ionicframework.com/t/error-with-ionic2/83711/8 "2017-03-21T22:15:49Z")

</div>

```
^

```

Error: Cannot find module 'reflect-metadata’  
at Function.Module.\_resolveFilename (module.js:325:15)  
at Function.Module.\_load (module.js:276:25)  
at Module.require (module.js:353:17)  
at require (internal/module.js:12:17)  
at Object. (C:\Users\ATIA\projet2\node\_modules@ionic\app-scripts  
\dist\aot\aot-compiler.js:4:1)  
at Module.\_compile (module.js:409:26)  
at Object.Module.\_extensions…js (module.js:416:10)  
at Module.load (module.js:343:32)  
at Function.Module.\_load (module.js:300:12)  
at Module.require (module.js:353:17)

npm ERR! Windows\_NT 6.1.7600  
npm ERR! argv “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\  
node\_modules\npm\bin\npm-cli.js” “run” “ionic:serve” “–” “–v2” “–address”  
“0.0.0.0” “–port” “8100” “–livereload-port” "35729"  
npm ERR! node v4.4.1  
npm ERR! npm v2.14.20  
npm ERR! code ELIFECYCLE  
npm ERR! ionic-hello-world@ ionic:serve: `ionic-app-scripts serve "--v2" "--addr ess" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"`  
npm ERR! Exit status 1  
npm ERR!  
npm ERR! Failed at the ionic-hello-world@ ionic:serve script ‘ionic-app-scripts  
serve “–v2” “–address” “0.0.0.0” “–port” “8100” “–livereload-port” “35729”’.

npm ERR! This is most likely a problem with the ionic-hello-world package,  
npm ERR! not with npm itself.  
npm ERR! Tell the author that this fails on your system:  
npm ERR! ionic-app-scripts serve “–v2” “–address” “0.0.0.0” “–port” “8100  
” “–livereload-port” "35729"  
npm ERR! You can get information on how to open an issue for this project with:  
npm ERR! npm bugs ionic-hello-world  
npm ERR! Or if that isn’t available, you can get their info via:  
npm ERR!  
npm ERR! npm owner ls ionic-hello-world  
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:  
npm ERR! C:\Users\ATIA\projet2\npm-debug.log  
There was an error serving your Ionic application: There was an error with the s  
pawned command: serve

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [March 21, 2017, 10:21pm UTC](https://forum.ionicframework.com/t/error-with-ionic2/83711/9 "2017-03-21T22:21:07Z")

</div>

Great. Here’s your problem:

> [@narjes](#):
>
> npm ERR! node v4.4.1

[You need at least Node 6](http://ionicframework.com/docs/v2/intro/installation/).

---

<div class="post-metadata">

**Author:** ![narjes](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@narjes](https://forum.ionicframework.com/u/narjes)\
**Post date:** [March 21, 2017, 10:56pm UTC](https://forum.ionicframework.com/t/error-with-ionic2/83711/10 "2017-03-21T22:56:56Z")

</div>

thanks alot ,but after update the node ,doesn’t work again :

C:\Users\ATIA\>node -v  
v6.10.1

C:\Users\ATIA\>ionic -v  
2.2.1

C:\Users\ATIA\>cd projet2

C:\Users\ATIA\projet2\>ionic serve -l

> ionic-hello-world@ ionic:serve C:\Users\ATIA\projet2  
> ionic-app-scripts serve “–v2” “–lab” “–address” “0.0.0.0” “–port” “8100” "  
> –livereload-port" “35729”

module.js:471  
throw err;  
^

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. (C:\Users\ATIA\projet2\node\_modules@ionic\app-scripts  
\dist\aot\aot-compiler.js:4: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)  
npm ERR! code ELIFECYCLE  
npm ERR! errno 1  
npm ERR! ionic-hello-world@ ionic:serve: `ionic-app-scripts serve "--v2" "--lab" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"`  
npm ERR! Exit status 1  
npm ERR!  
npm ERR! Failed at the ionic-hello-world@ ionic:serve script ‘ionic-app-scripts  
serve “–v2” “–lab” “–address” “0.0.0.0” “–port” “8100” “–livereload-port” "  
35729"’.  
npm ERR! Make sure you have the latest version of node.js and npm installed.  
npm ERR! If you do, this is most likely a problem with the ionic-hello-world pac  
kage,  
npm ERR! not with npm itself.  
npm ERR! Tell the author that this fails on your system:  
npm ERR! ionic-app-scripts serve “–v2” “–lab” “–address” “0.0.0.0” “–por  
t” “8100” “–livereload-port” “35729”  
npm ERR! You can get information on how to open an issue for this project with:  
npm ERR! npm bugs ionic-hello-world  
npm ERR! Or if that isn’t available, you can get their info via:  
npm ERR! npm owner ls ionic-hello-world  
npm ERR! There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:  
npm ERR! C:\Users\ATIA\AppData\Roaming\npm-cache\_logs\2017-03-21T22\_51\_53\_0  
34Z-debug.log  
There was an error serving your Ionic application: There was an error with the s  
pawned command: serve

C:\Users\ATIA\projet2\>

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [March 21, 2017, 11:00pm UTC](https://forum.ionicframework.com/t/error-with-ionic2/83711/11 "2017-03-21T23:00:32Z")

</div>

I would try completely erasing `node_modules`, running `npm cache clean` and then `npm install`. You may also wish to regenerate the project again, in case your old node messed up `package.json`.

---

<div class="post-metadata">

**Author:** ![narjes](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@narjes](https://forum.ionicframework.com/u/narjes)\
**Post date:** [March 21, 2017, 11:10pm UTC](https://forum.ionicframework.com/t/error-with-ionic2/83711/12 "2017-03-21T23:10:09Z")

</div>

okey,i’m trying again

---

<div class="post-metadata">

**Author:** ![narjes](https://avatars.discourse-cdn.com/v4/letter/n/f07891/32.png) [@narjes](https://forum.ionicframework.com/u/narjes)\
**Post date:** [March 21, 2017, 11:29pm UTC](https://forum.ionicframework.com/t/error-with-ionic2/83711/13 "2017-03-21T23:29:12Z")

</div>

Hi ,thanks a lot 😉 that works ( i generate a new project)  
but all my precious ionic1 projetcs not work !
