我已经使用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 installedI have started a clean project with ionic2 based on tabs template, by following the next steps:
$ ionic start <myapp> --v2 $ cd <myapp> $ ionic serveThen 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 hereMake shure that @ionic/app-scripts is now 1.1.4, and not 1.2.2.
And that's it.
更多推荐
发布评论