Ionic 4-当我运行"Ionic Server"时,意外地关闭了[ERROR] ng(退出代码1). [英] Ionic 4 - Getting [ERROR] ng has unexpectedly closed (exit code 1) when I run "ionic server"

查看:574
本文介绍了Ionic 4-当我运行"Ionic Server"时,意外地关闭了[ERROR] ng(退出代码1).的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在 Ionic4 项目上首次运行时,我正在为这个错误而苦苦挣扎.

I am struggling in this error when I try the first run on an Ionic4 project.

ng运行app:serve --host = 0.0.0.0 --port = 8100

ng run app:serve --host=0.0.0.0 --port=8100

[错误] ng意外关闭(退出代码1).

[ERROR] ng has unexpectedly closed (exit code 1).

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

我正在使用Linux Elementary OS(一个来自Ubuntu的不错的发行版).

I'm using Linux Elementary OS (a nice distro that came from Ubuntu).

我尝试运行一个 ionic3 项目,该项目成功运行.

I tried to run a ionic3 project and it ran successfully.

当我运行离子服务-详细时,我会收到此消息

When I run ionic serve --verbose I get this message

我已经尝试了很多事情,清理npm缓存",重新安装节点,重新安装ionic,启动/停止nodejs进程.但是没有任何成功. 因为我找不到与我的问题完全相同的人,所以我问你们.

I already tried many things, "npm cache clean", reinstall node, reinstall ionic, start/stop nodejs process. But without any success. As I am not finding anyone with the exactly same problem as mine I am asking you guys.

推荐答案

问题是我的NodeJS和JDK版本.

The problem was my version of NodeJS and JDK.

我使用"nvm use 8.12.0"来指向受支持的节点版本.另外,我还必须更改JDK的版本,我使用的是openJDK 8.

I used "nvm use 8.12.0" to point to supported node version. Also I have to change the version of my JDK, I used openJDK 8.

这篇关于Ionic 4-当我运行"Ionic Server"时,意外地关闭了[ERROR] ng(退出代码1).的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆