如何在 VS Code 中启用 Node.js Intellisense?

qqq*_*qqq 4 ide intellisense hint node.js visual-studio-code

如何在 VS Code 中启用 Node.js Intellisense?

例如,我知道 Node.js 中有一个常量__dirname,但是当我尝试输入__dirVS Code 时,我没有得到任何建议,而我希望将其__dirname视为建议。

在此处输入图片说明

我该怎么办?也许我应该安装一个插件?

这是我正在使用的 VS Code 版本:

Version: 1.33.1 (user setup)
Commit: 51b0b28134d51361cf996d2f0a1c698247aeabd8
Date: 2019-04-11T08:27:14.102Z
Electron: 3.1.6
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Windows_NT x64 10.0.17763
Run Code Online (Sandbox Code Playgroud)

谢谢你。

lia*_*dio 8

有一段时间回到:

npm install node;
Run Code Online (Sandbox Code Playgroud)

在项目根文件夹中,vscode(至少对我而言)足以为我提供 node 的智能感知。现在我还需要这样做:

npm install @types/node;
Run Code Online (Sandbox Code Playgroud)

再次在项目文件夹中。 同样的解决方案似乎从 vs code docs 中得到了建议