所以我刚开始学习 Angular 2,npm install
在 git bash 上运行命令并打开我的文本编辑器后,我试图运行npm start
命令来启动 typescript 和 lite 服务器。一切顺利,直到出现此错误[1] [BS] Couldn't open browser (if you are using BrowserSync in a headless environment, you might want to set the open option to false)
并且浏览器未打开。这是它的外观`
$ npm start
[1] [BS] Access URLs:
[1] --------------------------------------
[1] Local: http://localhost:3002
[1] External: http://172.30.31.239:3002
[1] --------------------------------------
[1] UI: http://localhost:3003
[1] UI External: http://172.30.31.239:3003
[1] --------------------------------------
[1] [BS] Serving files from: ./
[1] [BS] Watching files...
[1] [BS] Couldn't open browser (if you are using BrowserSync in a headless environment, you might want to set the open option to false)
`
我使用的是 Windows 8 64 位操作系统,Chrome 是默认浏览器
一个相关的问题https://stackoverflow.com/a/42845813/8130472得到了回答,并建议选择将 C:\Windows\System32 添加到系统变量中,但我不知道该怎么做。
此外,在此链接上,https://forums.bignerdranch.com/t/browser-sync-couldnt-open-browser/10936/4另一个建议是添加--browser"chrome.exe"(Windows)
. 那也没有用。
有什么建议么?或解决方案?