How can I enable a Node.js Intellisense in VS Code?
For instance, I am aware of a constant in Node.js __dirname
, but when I try to type __dir
in VS Code I am not getting any suggestions, while I would expect to see the __dirname
as a suggestion.
What can I do about it? Maybe I should install a plugin?
Here is the version of VS Code I am using:
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
Thank you.
One of the biggest advantages of using Visual Studio Code with node. js has to be Intellisense. If you want to see the available suggestions at any time, simply use the keyboard shortcut Ctrl-Space.
You can trigger IntelliSense in any editor window by typing Ctrl+Space or by typing a trigger character (such as the dot character (.) in JavaScript).
You can enable or disable particular IntelliSense features in the Options dialog box, under Text Editor > C/C++ > Advanced.
If IntelliSense is not working as it should on your Windows 11/10 PC, you can try restarting VS Code and this should solve the issue. Restarting the program can be really effective and time saving in some cases. If the issue persists, you can try restarting your computer altogether.
There was some time while a back that :
npm install node;
in the project root folder was enough for vscode (at least for my case) to give me intellisense for node . Now I need to do also that :
npm install @types/node;
again in the project folder . Also the same solution seems to be suggested from vs code docs .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With