visual-studio-code - 无法在 VS Code 中安装类型文件...,在 Windows 上的 Ubuntu 上使用 Bash

标签 visual-studio-code

我正在尝试在 Windows 上的 Ubuntu 上使用带有 Bash 的 Visual Studio Code。我在 Windows 上安装了 VS Code,但在其他情况下只将 Bash 用于我的 JavaScript 开发工作流程。

我有 nodenpm安装在 Bash 上(通过 apt-get),但是,我没有 nodenpm也在 Windows 上避免重复。在我的 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\""

是否可以通过 npm 让 VS Code 安装打字文件?安装在 Bash 上?

最佳答案

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

关于visual-studio-code - 无法在 VS Code 中安装类型文件...,在 Windows 上的 Ubuntu 上使用 Bash,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45468002/

相关文章:

powershell - VSCode 集成终端默认为 powershell core

java - vscode导入android.util.Log被覆盖为sun.rmi.runtime.Log;

visual-studio-code - VSCode中的动态代码段评估

python - 使用 Visual Studio Code 在 Python 中逐步调试导入的模块

python - 有什么方法可以参数化 VS Code 的 python.pythonPath 设置吗?

visual-studio-code - 启动 VSCode 后如何退出命令提示符

typescript - 如何在 VSCode、TypeScript 中悬停时查看完整的类型定义?

git - VS Code 源代码控制中时钟图标的含义

visual-studio-code - Dart/vscode : enforce function argument types when passing function itself as an argument to constructor

php - Visual Studio Code 中自定义函数的参数建议