离子不能与ionic2一起使用(Ionic serve not working with ionic2)

编程入门 行业动态 更新时间:2024-10-27 12:37:38
离子不能与ionic2一起使用(Ionic serve not working with ionic2)

我已经使用ionic2基于选项卡模板启动了一个干净的项目,通过以下步骤:

$ ionic start <myapp> --v2 $ cd <myapp> $ ionic serve

然后ionic serve的输出就是:

> ionic-hello-world@ ionic:serve /home/luan/<myapp> > ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"

如果我尝试打开localhost:8100 ,则无响应。

该项目的文件和代码与使用选项卡模板的文件和代码相同,但它不是唯一的。 有人可以帮忙吗?

更新:我的ionic info

My system information: Cordova CLI: 6.5.0 Ionic Framework Version: 2.3.0 Ionic CLI Version: 2.2.1 Ionic App Lib Version: 2.2.0 Ionic App Scripts Version: 1.2.2 ios-deploy version: Not installed ios-sim version: Not installed OS: Linux 4.4 Node Version: v6.10.0 Xcode version: Not installed

I have started a clean project with ionic2 based on tabs template, by following the next steps:

$ ionic start <myapp> --v2 $ cd <myapp> $ ionic serve

Then the output from ionic serve is just:

> ionic-hello-world@ ionic:serve /home/luan/<myapp> > ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"

If I try to open localhost:8100 there's no response.

The files and code of the project are just the same as one using tabs template, but it's just don't wonking. Could someone help?

UPDATE: My ionic info

My system information: Cordova CLI: 6.5.0 Ionic Framework Version: 2.3.0 Ionic CLI Version: 2.2.1 Ionic App Lib Version: 2.2.0 Ionic App Scripts Version: 1.2.2 ios-deploy version: Not installed ios-sim version: Not installed OS: Linux 4.4 Node Version: v6.10.0 Xcode version: Not installed

最满意答案

你有没有尝试过使用

npm run ionic:serve

I have found the answer. It turns out, the 1.2.2 version of Ionic App Scripts (app-scripts) version was the problem. Just downgraded to 1.1.4 and works fine. The actual workaround:

in package.json, change

"@ionic/app-scripts": "1.2.2"

to

"@ionic/app-scripts": "1.1.4"

then run npm install again. It should show something like this:

[...] - sentence-case@2.1.1 node_modules/sentence-case - change-case@3.0.1 node_modules/change-case ionic-hello-world@ /home/luan/Projetos/prestacontas └── @ionic/app-scripts@1.1.4 ## The problem was here

Make shure that @ionic/app-scripts is now 1.1.4, and not 1.2.2.

And that's it.

更多推荐

本文发布于:2023-08-02 06:48:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1370051.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:能与   离子   working   serve   Ionic

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!