1

I'm facing an issue with VScode and NodeJS with the code autocompletion

I did a bit of reserch on this topic and i found this stackoverflow post, I'm facing the similar issue mentioned in that post.

when I type console or any vanilla JavaScript code, VScode detect it and try's to suggest an autocomplete code.

but when I write NodeJS server side JavaScript code VScode aren't detecting it.

I've tried the solutions for that post, and here the output.

npm is installed globally

VScode --version 1.64.0

NodeJS --version 14.16.0

V8 -v 9.1.269.39

OS Windows 10

1 - run npm init to create package.json. It creates package.json but VScode didn't recognize it as a node code.

2 - run npm install --save-dev @types/node. Yes this works but I don't want to run this command and install mode_modules on every project, even if the project doesn't require any npm packages.

So simply my question is:

How can I install the code autocompletion globally on my system, without needing to install @types/node every time ?

  • You can install a node package globally by adding `-g` to the install command. Whether this solves the issue, I don't know. –  Feb 13 '22 at 10:28
  • Also your version of nodeJs is a year old. You might consider downloading a new version. – Andy Feb 13 '22 at 10:38

0 Answers0