I installed atom-live-server package, and when I start the server it doesn’t launch the default browser automatically, I must open the browser by myself, and type server URL with port number manually. How can I fix this?
How have you configured
I didn’t configure it, but I did something that maybe caused this problem. When I installed that package first time, it worked. After that, I reset default apps in Windows include default browser, then make Chrome default browser again. After that, I faced this problem.
Have you tried uninstalling and reinstalling the package?
Yes, and also:
- Deleted .atom folder to let Atom start fresh with default settings, and re-installed the package.
- Tried other editors: SublimeText, Brackets, PhpStorm. All works well except Atom.
- Made other browsers default, but nothing.
Do you know if the extensions or features of these other editors also use the
live-server package? If not or you don’t know, I’d like for you to try to run that package by itself just like
atom-live-server does and see if it works. I can coach you how to do it if you aren’t familiar with NPM or the command line.
I don’t know, but they’re using the default built-in packages. I didn’t change anything.
I installed node.js, opened npm, installed live-server package to run it by itself as you said, then issued the command “live-server” using PowerShell in my project’s directory, then the server worked but didn’t open the browser automatically, and it says:
Serving “My project’s path here” at http://127.0.0.1:8080
(node:6604) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: spawn cmd ENOENT
Ready for changes
This is both expected and weird. So yes, something about
live-server is not working with your system. The specific error tells me that it’s trying to spawn a
cmd process. So the next step to test is to see if you can create a
cmd process. Type
cmd into the command line and see what happens.
firstname.lastname@example.org on my own computer (Windows 10, Chrome default), and it works seamlessly.
Finally, problem solved!
When I’m searching now for the problem “Error: spawn cmd ENOENT”, I remembered that I changed the environment variables to run apm following these steps. Now I added the system32 folder to PATH following this solution and it works. Atom can open the default browser automatically now.
Thanks for your time @DamnedScholar
Good to know that it was easily remedied.
When I start atom-live-server it is also not launching the browser then, I checked manually it is running on the port 3000. To launch browser automatically. What should i do? I am using live server ver.2.3.0