question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ionic4 4.2.1 : Linux can't run "ionic serve" without an error

See original GitHub issue

I am struggling in this error when I try the first run on an Ionic4 project. when I try “ionic serve” I’m getting this error:

ng run app:serve --host=0.0.0.0 --port=8100
 [ERROR] ng has unexpectedly closed (exit code 1).
 The Ionic CLI will exit. Please check any output above for error details.

I didn’t change anything in the project, just created and tried to run. I tried in Windows and it works like a charm, but I can’t make it run on Linux. I tried other computers and I am getting the same error, what makes me believe there is a bug in ionic cli when running it in linux OR I should make some changes in linux to make it run.

When I run “ionic serve --verbose” I get this error “detail”: image

This my Ionic Info:

Ionic:

   ionic (Ionic CLI)             : 4.2.1 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.0.0-beta.13
   @angular-devkit/build-angular : 0.8.5
   @angular-devkit/schematics    : 0.8.5
   @angular/cli                  : 6.2.5
   @ionic/angular-toolkit        : 1.0.0

Cordova:

   cordova (Cordova CLI) : not installed
   Cordova Platforms     : none
   Cordova Plugins       : no whitelisted plugins (0 plugins total)

System:

   NodeJS : v10.12.0 (/snap/node/1149/bin/node)
   npm    : not installed
   OS     : Linux 4.15

Although it is saying that npm and Cordova are not installed, they are installed, at least if I run “npm --version” it returns to me with “6.4.1” and cordova “8.1.2 (cordova-lib@8.1.1)”.

Ionic3 projects is running smoothly.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
imhoffdcommented, Oct 19, 2018

@davidrock What happens if you run npx ng serve?

1reaction
pramathacommented, Feb 22, 2019

Try this: $ npm install $ npm audit fix

Read more comments on GitHub >

github_iconTop Results From Across the Web

Serve does not work (Ionic 4) - #20 by boffin
I created new Ionic 4 app, with updates ionic-cli and I cant run ionic ... In Ionic4 4.2.1 : Linux can't run "ionic...
Read more >
I cant run ionic serve - node.js - Stack Overflow
Can somebody help me? I'm new in ionic. When I try to run serve, this error appears. I ran sudo npm install -g...
Read more >
@ionic/app-scripts - npm
Helper scripts to get Ionic apps up and running quickly (minus the config overload). To get the latest @ionic/app-scripts , please run: npm ......
Read more >
Ionic 4 - Getting [Error] Ng Has Unexpectedly Closed (Exit ...
I got this error when i run ionic serve The Ionic CLI will exit. Ionic4 4.2.1 : Linux can't run ionic serve without...
Read more >
http failure response for 0 unknown error ionic 5 - You.com
My Ionic 4 app working fine on Chrome but when I run it on emulator it gave me ... "examples/storage/cassandra/cassandra-service.yaml" does not exist...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found