Ionic-cli: ionic serve says okay but not working ! ==?

Created on 14 Nov 2017  路  23Comments  路  Source: ionic-team/ionic-cli

ekran alintisi
ekran alintisi
as you can see it says okay but not working. please help me . my ionic CLI 3.18.0 and npm and everyting is lastest version. but its not working .

and 谋 am not using daemon something. 谋 just want to when 谋 am write ionic serve its open my project. but for now its now working be hurry . please !

Most helpful comment

SOLVED....

In order to solve the error with cordova trying to get the android platform, I stumbled on a related issue to do with adding plugins. The solution is add c:\windows\system32 to the PATH environment variables. This has ultimately solved the issue of ionic serve starting and stopping as well

Thanks for sticking with me on this, we got there in the end.

All 23 comments

@Ejdersoy Are you using git bash?

@dwieeb no 谋 am not. node js.

@Ejdersoy I meant what terminal are you using? cmd.exe? git bash? hyper terminal?

@dwieeb 谋 am using cmd.exe

Same happens to me. At the moment i'm able to work by executing npm run ionic:serve instead. @dwieeb youcould try it meanwhile.

image

image

Any ideas?

No ideas immediately... it just seems to be outright failing silently on Windows.

After running ionic serve, can you run echo %errorlevel% and tell me what number it is?

Hi dwieeb when i use to run this command echo %errorlevel% it gives me 1 as output.
image


@ParagPallav @gregduffield Do you see this behavior on other terminals, such as Git Bash or hyper? What about other NodeJS versions?

I have now tried various other versions of node but see the same thing.
I have tried powershell, cmd and the same thing.
I have not tried Bash as I am not willing to change my command toolset for somehting that should work. I am paying for a Pro license at the moment, but it looks like we will not be progressing as we are not able to get past this issue.

I will of course provide any help/information that I can to address this issue, as it would have been good to be able to use the Ionic Framework as designed.

@gregduffield I understand. I'm not asking you to change your toolset, I'm trying to narrow down the issue so I can address it. I've asked several coworkers and they're not able to reproduce the issue either. Thank you for trying different ideas with me while we debug this.

Can you try ionic serve --local? This should bind the servers to localhost instead of all network interfaces. Are you connected to a network that might kill the connections? Firewall, etc?

I have tried the -local option and this made no difference.
I have tried turning off the windows firewall and this made no difference ( there are no other firewalls running)
basically the same thing happens,, we get the OK message then the local, external and DevApp urls and then get shown the prompt. I can see that this works momentarily because if I am running the DevApp My Application gets listed very briefly. for some reason the dev server process is just quitting instead of continuing to run.

--local will also disable the DevApp, so it doesn't appear to be anything related to the multicast code.

Can I have you try ionic@canary? In this alpha-version CLI, I have changed how ionic serve works, shelling out to @ionic/app-scripts instead of importing and running it. I just want to see if that will fix it for you. If it does, I will backport the code to CLI v3, because CLI v4 has not gone through any beta testing.

Install CLI v4 canary:

npm uninstall -g ionic
npm install -g ionic@canary

Back to CLI v3:

npm uninstall -g ionic
npm install -g ionic@latest

Ok i have just tried this and updated to canary

@ionic/cli-utils  : 2.0.0-alpha.273c8f1c
   ionic (Ionic CLI) : 4.0.0-alpha.273c8f1c

but sorry to say the same thing still happens. Starts and stops

Yet npm run ionic:serve works?

Do you have Cordova setup? If so, can you also try ionic cordova run android -l?

yes npm run ionic:serve does work

I have tried adding the android platform but get another error (this has been reported by others as well)

PS C:\Users\g.duffield\source\repos\EventManager> cordova platform add android
Using cordova-fetch for cordova-android@~7.0.0
(node:24084) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): CordovaError: Failed to fetch platform cordova-android@~7.0.0
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
Error: cmd: Command failed with exit code ENOENT
(node:24084) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

SOLVED....

In order to solve the error with cordova trying to get the android platform, I stumbled on a related issue to do with adding plugins. The solution is add c:\windows\system32 to the PATH environment variables. This has ultimately solved the issue of ionic serve starting and stopping as well

Thanks for sticking with me on this, we got there in the end.

@dwieeb @gregduffield npm run ionic:serve this command worked for me . and i am able to run my app in my local.
Thanks

@gregduffield I'm confused.. is ionic serve working for you now?

@dwieeb yes. after updating the path environment variable ionic serve is working for me thanks

@gregduffield thanks! I can confirm: this works for me, too.

@gregduffield Thanks...
Adding c:windowssystem32 to the PATH environment variables solved the issue...

@gregduffield Thank you for the solution. I was facing the same issue, adding windows/system32 in environment variable resolved the issue.

@gregduffield Also worked for me! Thanks!!!

Was this page helpful?
0 / 5 - 0 ratings