Projects created with Ionic 2 do not execute

Asked

Viewed 50 times

1

I create my projects without problems, but at the command: ionic serve, I have the following result:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\allan\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'ionic:serve',
1 verbose cli   '--',
1 verbose cli   '--v2',
1 verbose cli   '--address',
1 verbose cli   '0.0.0.0',
1 verbose cli   '--port',
1 verbose cli   '8100',
1 verbose cli   '--livereload-port',
1 verbose cli   '35729' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'preionic:serve', 'ionic:serve', 'postionic:serve' ]
5 info lifecycle ionic-hello-world@~preionic:serve: ionic-hello-world@
6 silly lifecycle ionic-hello-world@~preionic:serve: no script for preionic:serve, continuing
7 info lifecycle ionic-hello-world@~ionic:serve: ionic-hello-world@
8 verbose lifecycle ionic-hello-world@~ionic:serve: unsafe-perm in lifecycle true
9 verbose lifecycle ionic-hello-world@~ionic:serve: PATH: C:\Users\allan\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;C:\Users\allan\Documents\workspace-ionic\app2\node_modules\.bin;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Git\cmd;C:\Users\allan\AppData\Local\Android\sdk\platform-tools;C:\Program Files\nodejs\;C:\Users\allan\AppData\Local\Microsoft\WindowsApps;C:\Users\allan\AppData\Local\atom\bin;C:\Users\allan\AppData\Roaming\npm
10 verbose lifecycle ionic-hello-world@~ionic:serve: CWD: C:\Users\allan\Documents\workspace-ionic\app2
11 silly lifecycle ionic-hello-world@~ionic:serve: Args: [ '/d /s /c',
11 silly lifecycle   'ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"' ]
12 silly lifecycle ionic-hello-world@~ionic:serve: Returned: code: 1  signal: null
13 info lifecycle ionic-hello-world@~ionic:serve: Failed to exec ionic:serve script
14 verbose stack Error: ionic-hello-world@ ionic:serve: `ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (C:\Users\allan\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:279:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:191:7)
14 verbose stack     at ChildProcess.<anonymous> (C:\Users\allan\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:886:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid ionic-hello-world@
16 verbose cwd C:\Users\allan\Documents\workspace-ionic\app2
17 verbose Windows_NT 10.0.14393
18 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\allan\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "ionic:serve" "--" "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"
19 verbose node v6.10.1
20 verbose npm  v4.4.4
21 error code ELIFECYCLE
22 error errno 1
23 error ionic-hello-world@ ionic:serve: `ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"`
23 error Exit status 1
24 error Failed at the ionic-hello-world@ ionic:serve script 'ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"'.
24 error Make sure you have the latest version of node.js and npm installed.
24 error If you do, this is most likely a problem with the ionic-hello-world package,
24 error not with npm itself.
24 error Tell the author that this fails on your system:
24 error     ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"
24 error You can get information on how to open an issue for this project with:
24 error     npm bugs ionic-hello-world
24 error Or if that isn't available, you can get their info via:
24 error     npm owner ls ionic-hello-world
24 error There is likely additional logging output above.
25 verbose exit [ 1, true ]

All new projects look like this. Older projects run normally. Can someone help me?

1 answer

1

According to the error message, you may be running an older or incompatible version of node.js or npm. In this case, I recommend you try to install the most current version (if you don’t already have it). You can install by command prompt (assuming you are using Windows) usingnpm install -g npm-windows-upgrade.

Other than that, the message indicates that you can get more information from the bug by running the command npm bugs ionic-hello-world.

  • Thank you very much! I managed to solve!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.