ionic serve not open the browser - ionic-framework

In the project, ionic serve show:
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/
And the browser not open.
My system
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
Why the ionic serve don't show ionic $?
In ionic 1 show:
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 $
But not in ionic2.

try this code
ionic serve --address=localhost

First try this command line:
npm run ionic:serve
and if does't help try the second one:
npm install --save-dev #ionic/app-scripts#latest
then
ionic serve

Related

Unable to build android in IONIC 6

When I run ionic cordova build android –prod i get the error:
Downloading https://services.gradle.org/distributions/gradle-7.1.1-all.zip
Exception in thread "main" java.io.IOException: Downloading from https://services.gradle.org/distributions/gradle-7.1.1-all.zip failed: timeout
I'm behind a proxy, so I set
ionic config set -g proxy http://proxy-..***:9999
I have executed ionic start myApp tabs --cordova --type=angular
I have executed ionic serve
but i can't do the build
I will be very grateful if you can help me please.
Ionic:
Ionic CLI: 6.20.3
Ionic Framework: #ionic/angular 6.3.2
Cordova:
Cordova CLI: 11.0.0
Cordova Platforms: android 10.1.2
Utility:
cordova-res: not installed globally
native-run: not installed globally
System:
NodeJS: v16.17.0 (C:\Program Files\nodejs\node.exe)
npm: 8.15.0
OS: Windows 10
Make sure you already added android in your ionic app then proceed on these steps.
Download the gradle: https://services.gradle.org/distributions/gradle-7.1.1-all.zip
Place the zip file inside: {YourAppName}/platforms/android/gradle
Set an environment variable in your OS: CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL="../gradle-7.1.1-all.zip"
Run ionic cordova build android --prod

ionic run browser --livereload not working

i was trying to use live reload on my ionic 2 application. so i found this command
ionic run browser --live-reload
is not working as expected and while making code changes i am receiving console messages
[16:12:47] build started ...
[16:12:47] transpile update started ...
[16:12:47] transpile update finished in 46 ms
[16:12:47] deeplinks update started ...
[16:12:47] deeplinks update finished in 248 ms
[16:12:47] webpack update started ...
but the page isn't reloading
i found the solution on the github page
include a script in the package.json file
"browser": "ionic-app-scripts serve --sourceMap source-map --iscordovaserve --wwwDir platforms/browser/www/ --buildDir platforms/browser/www/build"
and run
npm run browser
When you run the command ionic cordova run browser --livereload you will see something like this in CLI:
[19:39:00] dev server running: http://localhost:8100/
[INFO] Development server running
Local: http://localhost:8100
External: http://192.168.0.51:8100
Just open http://192.168.0.51:8100 or http://localhost:8100 and your live reload will work on that address. Your browser might have opened in http://localhost:8000 instead of 8100
First off, should anyone need this answer, the command has been renamed in the later version to
ionic cordova run browser
Second, The --livereload flag is not supported when you run this command. this issue explains more
Try This
ionic cordova run browser --livereload --consolelogs --serverlogs
"serve": "npx ionic serve --cordova --platform browser"
Using this command browser will be reloaded automatically.
ionic serve
If you want to run application with different platform in browser you can use this command :
ionic serve -l
This both command will reload page automatically on code change

ionic serve --lab not showing different platform views

I have recently been trying to ionic labs view a try. From the docs, its as simple as the command ionic serve --lab . But this only shows the normal ionic serve view not android and iphone view . I do not see any errors.
$ ionic serve -l
> ionic-hello-world# ionic:serve /home/raj/ionic/bookemon
> ionic-app-scripts serve "--v2" "--lab" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"
[12:10:35] ionic-app-scripts 1.0.0
[12:10:35] watch started ...
[12:10:35] build dev started ...
[12:10:35] clean started ...
[12:10:35] clean finished in 6 ms
[12:10:35] copy started ...
[12:10:35] transpile started ...
[12:10:39] transpile finished in 3.58 s
[12:10:39] webpack started ...
[12:10:39] copy finished in 3.74 s
[12:10:46] webpack finished in 6.89 s
[12:10:46] sass started ...
[12:10:47] sass finished in 719 ms
[12:10:47] build dev finished in 11.23 s
[12:10:47] watch ready in 11.31 s
[12:10:47] dev server running: http://localhost:8100/
This is my ionic info
Your system information:
Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.6
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.4
Node Version: v7.2.1
Xcode version: Not installed
Not sure whats going on here. I tried reinstalling ionic and npm_modules but its not working. Any help? Thanks in advance.
Are you sure that you are opening http://localhost:8101/ionic-lab and NOT just http://localhost:8101 ?
Run ionic serve --lab or ionic serve -l
Goto http://localhost:8101/ionic-lab
Note
localhost:8101 loads the normal view and
localhost:8101/ionic-lab loads the view with options to various platform
"scripts": {
"build": "ionic-app-scripts build",
"watch": "ionic-app-scripts watch",
"serve:before": "watch",
"emulate:before": "watch",
"deploy:before": "build",
"build:before": "build",
"run:before": "watch"
}
In package.json change scripts to above and run ionic serve -l
i think ionic serve -l doesn't work since ionic 2 using
ionic-app-scripts.
while, them using ionic view app, for live test.
check here https://play.google.com/store/apps/details?id=com.ionic.viewapp&hl=en

ionic serve command fails with "build dev failed: Cannot find module '../util/Logger'"

I create and run an ionic project using
ionic start test1 blank --v2
cd test1
ionic serve
And I get:
[13:48:30] ionic-app-scripts 0.0.42
[13:48:30] watch started ...
[13:48:30] build dev started ...
[13:48:30] clean started ...
[13:48:30] clean finished in 1 ms
[13:48:30] copy started ...
[13:48:30] transpile started ...
[13:48:34] transpile finished in 4.04 s
[13:48:34] webpack started ...
[13:48:34] build dev failed: Cannot find module '../util/Logger'
[13:48:35] copy finished in 4.13 s
[13:48:35] watch ready in 4.14 s
I tried to remove the node-modules directory and make "npm install" to rebuild the modules, but with the same result. (even reinstalled ionic framefork)
I have a Linux Mint 18.

Ionic link does not work with Ionic v2

When I run ionic link command inside ionic project folder I got following error message
"You cannot run this command unless you are in an Ionic Project folder"
My system info.
Cordova CLI: 6.3.1
Gulp version: CLI version 1.2.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.11
Ionic CLI Version: 2.0.0-beta.36
Ionic App Lib Version: 2.0.0-beta.19
OS: Distributor ID: Ubuntu Description: Ubuntu 14.04.4 LTS
Node Version: v6.4.0
You can use following command to setup app linking with Ionic IO.
ionic io init
this will update ionic.config.json with app_id and generate .io-config.json file with app_id and api_key.
ionic io init
is no longer available in cli 3. Create a new app from apps.ionic.io dashboard and then run
ionic link
which will list down apps from your ionic.io account and let you choose an app to which you want to link your local app. You have to run 'ionic login' if you haven't done so already.