我正在尝试在 Windows 上的 Ubuntu 上使用带有 Bash 的 Visual Studio Code。我在 Windows 上安装了 VS Code,但在其他情况下只将 Bash 用于我的 JavaScript 开发工作流程。
我有 node
和 npm
安装在 Bash 上(通过 apt-get
),但是,我没有 node
和 npm
也在 Windows 上避免重复。在我的 VS Code 设置中,我已将集成 shell 配置为使用 Bash:
"terminal.integrated.shell.windows": "C:\\windows\\Sysnative\\bash.exe"
集成 shell 工作正常,并且
node
和 npm
都可以访问。但是,当我在我的项目上启动 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/