Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
533 views
in Technique[技术] by (71.8m points)

node.js - Browser not launching with BrowserSync or live-server

I've been using live-server with VS Code to debug some web pages. Everything was fine, I ran live-server from my command line in the page directory and Chrome opened a new tab with the page.

Then suddenly it stopped working! I though it was a bit weird so I installed Nodejs again and an issue appeared afterwards. The server is working but it isn't able to open Chrome (nor any other Browser)

I tried using BrowserSync instead of live-server and again, the server works but it isn't able to automatically open Chrome

I can always manually type http://localhost:3000 but I shouldn't (since it worked before)

I've tried uninstalling and installing both live-server and browserSync, Chrome. Flushing my dns, checking for malware, checking if Windows Firewall is blocking anything related, and some other things that hadn't done anything for me, I still get the:

Couldn't open browser (if you are using BrowserSync in a headless environment, you might want to set the open option to false)

as seen here

Can someone please tell me what could be causing this issue or how should I attempt to fix it?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The problem occurred because somehow C:WindowsSystem32 was not in the System Path Variable. I just added it again, restarted the computer and it works fine again


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.8k users

...