Error when execute Ionic serve

Hello everyone,

When I execute ionic serve, the following error appears:

> ionic-app-scripts serve --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobrowser
[app-scripts] “sh” no se reconoce como un comando interno o externo,
[app-scripts] programa o archivo por lotes ejecutable.

[ERROR] ionic-app-scripts has unexpectedly closed (exit code 1).

_ The Ionic CLI will exit. Please check any output above for error details._

The versions that I have installed are:

Ionic:

** ionic (Ionic CLI) : 4.7.1 **
** Ionic Framework : ionic-angular 3.9.2**
** @ionic/app-scripts : 3.2.1**

Cordova:

** cordova (Cordova CLI) : not installed**
** Cordova Platforms : android 7.1.4**
** Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 1.2.1, (and 6 other plugins)**

System:

** NodeJS : v10.13.0**
** npm : 6.4.1**
** OS : Windows 7**

Can anyone help me?

Thank you so much in advanced

try ionic serve --verbose then post the logs

Thank you so much for your answer Alexis182.

This is the log of executing ionic serve --verbose:

ionic:lib Terminal info: { tty: true, ci: false, windows: true } +0ms
ionic:lib CLI global options: { _: [ ‘serve’ ], help: null, h: null, verbose: true, quiet: null, interactive: true, color: true, confirm: null, json: null, project: null, ‘–’: } +16ms
ionic:lib:project Project type from config: Ionic 2/3 (ionic-angular) +0ms
ionic:lib:project Project details: { configPath: ‘D:\app\ionic.config.json’, errors: , context: ‘app’, type: ‘ionic-angular’ } +1ms
ionic Context: { binPath: ‘C:\AppData\Roaming\npm\node_modules\ionic\bin\ionic’, libPath: ‘C:\AppData\Roaming\npm\node_modules\ionic’, execPath: ‘D:\app’, version: ‘4.7.1’ } +0ms
ionic:lib:telemetry Sending telemetry for command: ‘ionic serve’ [ ‘–verbose’, ‘–interactive’, ‘–color’ ] +0ms
ionic:lib:hooks Looking for ionic:serve:before npm script. +0ms
ionic:utils-network checking for open port on 0.0.0.0:8100 +0ms
ionic:utils-network checking for open port on 0.0.0.0:35729 +11ms
ionic:utils-network checking for open port on 0.0.0.0:53703 +1ms
ionic:utils-network checking for open port on fe80::fcb0:1fa0:2e2d:3cde:8100 +5ms
ionic:utils-network checking for open port on fe80::fcb0:1fa0:2e2d:3cde:35729 +1ms
ionic:utils-network checking for open port on fe80::fcb0:1fa0:2e2d:3cde:53703 +1ms
ionic:utils-network checking for open port on 192.168.214.110:8100 +1ms
ionic:utils-network checking for open port on 192.168.214.110:35729 +1ms
ionic:utils-network checking for open port on 192.168.214.110:53703 +0ms
ionic:utils-network checking for open port on fe80::5cac:c019:74e7:f576:8100 +2ms
ionic:utils-network checking for open port on fe80::5cac:c019:74e7:f576:35729 +0ms
ionic:utils-network checking for open port on fe80::5cac:c019:74e7:f576:53703 +1ms
ionic:utils-network checking for open port on 192.168.56.1:8100 +1ms
ionic:utils-network checking for open port on 192.168.56.1:35729 +1ms
ionic:utils-network checking for open port on 192.168.56.1:53703 +0ms
ionic:utils-network checking for open port on ::1:8100 +2ms
ionic:utils-network checking for open port on ::1:35729 +0ms
ionic:utils-network checking for open port on ::1:53703 +1ms
ionic:utils-network checking for open port on 127.0.0.1:8100 +2ms
ionic:utils-network checking for open port on 127.0.0.1:35729 +1ms
ionic:utils-network checking for open port on 127.0.0.1:53703 +0ms
ionic:lib:project:ionic-angular:serve Looking for ionic:serve npm script. +0ms
ionic:lib:project:ionic-angular:serve Found ionic:serve, but it is the default. Not running. +25ms

ionic-app-scripts serve --address 0.0.0.0 --port 8100 --livereload-port 35729 --dev-logger-port 53703 --nobrowser
[app-scripts] “sh” no se reconoce como un comando interno o externo,
[app-scripts] programa o archivo por lotes ejecutable.
ionic:lib:serve received unexpected close for ionic-app-scripts (code: 1) +0ms

[ERROR] ionic-app-scripts has unexpectedly closed (exit code 1).

    The Ionic CLI will exit. Please check any output above for error details.

ionic:cli-framework:utils:process onBeforeExit handler: process.exit received +0ms
ionic:cli-framework:utils:process onBeforeExit handler: running 1 functions +0ms
ionic:cli-framework:utils:process error while killing process tree for 9900: { Error: Command failed: taskkill /pid 9900 /T /F
ionic:cli-framework:utils:process ERROR: no se encontr� el proceso “9900”.
ionic:cli-framework:utils:process
ionic:cli-framework:utils:process at ChildProcess.exithandler (child_process.js:294:12)
ionic:cli-framework:utils:process at ChildProcess.emit (events.js:182:13)
ionic:cli-framework:utils:process at maybeClose (internal/child_process.js:962:16)
ionic:cli-framework:utils:process at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
ionic:cli-framework:utils:process killed: false,
ionic:cli-framework:utils:process code: 128,
ionic:cli-framework:utils:process signal: null,
ionic:cli-framework:utils:process cmd: ‘taskkill /pid 9900 /T /F’ } +255ms
ionic:cli-framework:utils:process onBeforeExit handler: error from function: { Error: Command failed: taskkill /pid 9900 /T /F
ionic:cli-framework:utils:process ERROR: no se encontr� el proceso “9900”.
ionic:cli-framework:utils:process
ionic:cli-framework:utils:process at ChildProcess.exithandler (child_process.js:294:12)
ionic:cli-framework:utils:process at ChildProcess.emit (events.js:182:13)
ionic:cli-framework:utils:process at maybeClose (internal/child_process.js:962:16)
ionic:cli-framework:utils:process at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
ionic:cli-framework:utils:process killed: false,
ionic:cli-framework:utils:process code: 128,
ionic:cli-framework:utils:process signal: null,
ionic:cli-framework:utils:process cmd: ‘taskkill /pid 9900 /T /F’ } +3ms
ionic:cli-framework:utils:process onBeforeExit handler: exiting (exit code 1) +3ms

Hidden comments

Los logs siempre está bueno ponerlos en un “Hide Details”, que lo encontrás en la misma barra de edición de texto del foro (dentro del engranaje). Justamente como este comentario.

Y sí o sí hay que ponerlos en Preformatted text para que sea más simple leerlos.

De acuerdo con ésta pregunta podrías revisar el siguientes enlace:


o este
https://cygwin.com/install.html

Probablemente luego debas reinstalar ionic y cordova

2 Likes

Muchas gracias por la respuesta, lo probaré en cuanto me sea posible. Actualmente he podido hacer lo mismo usando el comando npm run ionic:serve

Thank you so much for the answer, I will try it when it is possible for me. Actually I made the same with this command npm run ionic:serve

Hi,
I installed it and re-install ionic and cordova and the result is the same. Any other suggestion?
Thank you so much in advance.

Hola,
Lo he instalado y reinstalado ionic y cordova y el resultado es el mismo. ¿Alguna otra sugerencia?
Muchas gracias.

Are you fine this error now?lreneC

Yes, I’m fine with this error.
After uninstall and install many times all, it works. It was a nightmare and took a lot of days to resolve it.