【问题标题】:Can't run debugging in Visual Studio Code on Chrome OS无法在 Chrome OS 上的 Visual Studio Code 中运行调试
【发布时间】:2022-09-20 18:05:25
【问题描述】:

如何在 Chrome OS 上的 VS Code 中运行 .html 文件?它说我需要在 Json 文件中添加浏览器的绝对路径。

Trying to open a .html file in VS Code on Chrome OS

【问题讨论】:

  • 你在什么操作系统上?
  • Chrome OS,我能够通过 Firefox 和 Chromium 运行它,作为 Linux Beta 上的 Linux 应用程序安装。但不在 Chrome OS 上的默认 Chrome 浏览器中。
  • Live Server 这样的扩展会有帮助吗?试试看。

标签: visual-studio-code google-chrome-os


【解决方案1】:

你需要在 VS Code 上安装一个单独的 Chrome 版本,然后它才能工作。我刚刚遇到了同样的问题,并在 Reddit 上的某个地方找到了解决方案,但它确实有效 :-)

sudo apt install 铬

然后你可以把它添加到你的 .vscode/launch.json

  "configurations": [
    {
      "type": "chrome",
      "request": "launch",
      "name": "Launch Chrome against localhost",
      "runtimeExecutable": "/usr/bin/chromium",
      "url": "http://localhost:3000",
      "webRoot": "${workspaceFolder}",
      "smartStep": true
    }
  ]

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-01-27
    • 1970-01-01
    • 1970-01-01
    • 2015-07-09
    • 2017-12-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多