【发布时间】:2018-01-10 02:26:58
【问题描述】:
我正在尝试在 Windows 上的 Ubuntu 上使用 Visual Studio Code 和 Bash。我在 Windows 上安装了 VS Code,但在其他方面将 Bash 专门用于我的 JavaScript 开发工作流程。
我在 Bash 上安装了 node 和 npm(通过 apt-get),但是,我在 Windows 上也没有 node 和 npm 以避免重复。在我的 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\""
是否可以通过安装在 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 安装路径中。