【问题标题】:Could not install typings files... in VS Code, with Bash on Ubuntu on Windows无法在 VS Code 中安装类型文件...,在 Windows 上的 Ubuntu 上使用 Bash
【发布时间】:2018-01-10 02:26:58
【问题描述】:

我正在尝试在 Windows 上的 Ubuntu 上使用 Visual Studio Code 和 Bash。我在 Windows 上安装了 VS Code,但在其他方面将 Bash 专门用于我的 JavaScript 开发工作流程。

我在 Bash 上安装了 nodenpm(通过 apt-get),但是,我在 Windows 上也没有 nodenpm 以避免重复。在我的 VS Code 设置中,我已将集成 shell 配置为使用 Bash:

"terminal.integrated.shell.windows": "C:\\windows\\Sysnative\\bash.exe"

集成的 shell 工作正常,nodenpm 都可以访问。但是,当我在我的项目上启动 VS Code 时,我收到了警告:

Could not install typings files for JavaScript langauge features. Please ensure that NPM is installed or configure 'typescript.npm' in your user settings

我尝试了以下两种设置,但都不起作用:

"typescript.npm": "C:\\windows\\Sysnative\\bash.exe"
"typescript.npm": "C:\\windows\\Sysnative\\bash.exe -c \"npm\""

是否可以通过安装在 Bash 上的 npm 让 VS Code 安装类型文件?

【问题讨论】:

  • 你可以在这里找到解决方案stackoverflow.com/questions/44450218/…查看Node.js & NPM部分
  • 猜猜你的 Windows 机器上也安装了 Git。你可以试试这个看看它是否会工作:“terminal.integrated.shell.windows”:“C:\\Program Files\\Git\bin\\bash.exe”。但请确保 bash.exe 位于该 Git 安装路径中。

标签: visual-studio-code


【解决方案1】:

尝试在设置文件中设置“externalTerminal.windowsExec”: “bash”,将其设置为终端可执行文件,然后重启VS Code

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-10-13
    • 1970-01-01
    • 2018-06-06
    • 2018-07-02
    • 2017-05-07
    • 1970-01-01
    • 2018-09-29
    • 2017-06-02
    相关资源
    最近更新 更多