Error with ionic2

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 :


and i tried to install npm ,i got that : image
pleaase any help :frowning:

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

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

I and the entirety of StackOverflow disagree very strenuously with you about that for a myriad of reasons.

1 Like

why ? so if y can’t help me ,that’s alright !
please, 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?

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” :frowning:

^

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

Great. Here’s your problem:

You need at least Node 6.

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>

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.

okey,i’m trying again

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