ionic服务无法打开浏览器

时间:2017-01-08 18:42:39

标签: ionic-framework ionic2

在项目中,ionic serve显示:

vega@vega-linux:/opt/projetos/myPorject$ ionic serve

> ionic-hello-world@ ionic:serve /opt/projetos/myPorject
> ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"

keywords if/then/else require v5 option
[16:28:19]  ionic-app-scripts 0.0.47 
[16:28:20]  watch started ... 
[16:28:20]  build dev started ... 
[16:28:20]  clean started ... 
[16:28:20]  clean finished in 6 ms 
[16:28:20]  copy started ... 
[16:28:20]  transpile started ... 
[16:28:22]  transpile finished in 2.91 s 
[16:28:22]  webpack started ... 
[16:28:23]  copy finished in 3.06 s 
[16:28:30]  webpack finished in 7.81 s 
[16:28:30]  sass started ... 
[16:28:32]  sass finished in 1.42 s 
[16:28:32]  build dev finished in 12.18 s 
[16:28:32]  watch ready in 12.25 s 
[16:28:32]  dev server running: http://localhost:8100/ 

浏览器未打开。

我的系统

Your system information:

Cordova CLI: 6.4.0 
Ionic Framework Version: 2.0.0-rc.4
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
Ionic App Scripts Version: 0.0.47
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.4
Node Version: v7.4.0
Xcode version: Not installed

为什么ionic serve不显示ionic $

离子1显示:

vega@vega-linux:/opt/projetos/teste$ ionic serve
Running live reload server: http://192.168.2.103:35729
Watching: www/**/*, !www/lib/**/*, !www/**/*.map
√ Running dev server:  http://192.168.2.103:8100
Ionic server commands, enter:
  restart or r to restart the client app from the root
  goto or g and a url to have the app navigate to the given url
  consolelogs or c to enable/disable console log output
  serverlogs or s to enable/disable server log output
  quit or q to shutdown the server and exit

ionic $

但不是在ionic2。

2 个答案:

答案 0 :(得分:0)

试试这段代码

ionic serve --address=localhost

答案 1 :(得分:0)

首先尝试此命令行:

npm run ionic:serve

如果没有帮助尝试第二个:

npm install --save-dev @ionic/app-scripts@latest

然后

ionic serve