简体   繁体   English

实时服务器没有自动打开网站

[英]live-server not opening up the website automatically

I installed node.js, and "npm install -g live-server" After that the input of "live-server" in the command line prompt should open up the website that is situated in the current folder, but every time I try to do that, this shows up:我安装了node.js,然后“npm install -g live-server”在命令行提示中输入“live-server”应该打开位于当前文件夹中的网站,但每次我尝试这样做,这显示:

      Serving "C:\Users\AAYUSHI\bg-gen" at http://127.0.0.1:8080
      events.js:288
      throw er; // Unhandled 'error' event
      ^

      Error: spawn cmd ENOENT
      at Process.ChildProcess._handle.onexit           (internal/child_process.js:267:19)
      at onErrorNT (internal/child_process.js:469:16)
      at processTicksAndRejections (internal/process/task_queues.js:84:21)  Emitted 'error' event on
      ChildProcess instance at:
      at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
      at onErrorNT (internal/child_process.js:469:16)
      at processTicksAndRejections (internal/process/task_queues.js:84:21) {   errno: 'ENOENT',   code:     
     'ENOENT',   syscall: 'spawn cmd',   path: 'cmd',   spawnargs: [ '/c',
     'start', '""', '/b', 'http://127.0.0.1:8080' ] }

No browser opens up my website automatically.没有浏览器会自动打开我的网站。 What do you think is the problem?你认为有什么问题?

I checked system variables one more time and found the cause of the problem: missing C:\\Windows\\System32\\ variable.我又查了一遍系统变量,找到了问题的原因:缺少C:\\Windows\\System32\\变量。 I added it and that solved my problem我添加了它,这解决了我的问题

Hope, it help you too.希望对你也有帮助。

Most likely issue with opening the browser.最有可能是打开浏览器的问题。 Use this option instead: live-server dist --port=3000 --no-browser请改用此选项: live-server dist --port=3000 --no-browser

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM