8

I've tried following these instructions:

https://code.visualstudio.com/Docs/runtimes/nodejs

I am not getting the green/red swiggly lines at all. Is there something I'm missing?

You can also see the same thing in this video:

https://youtu.be/sE8_bTEBlFg?t=1m37s

As far as I know, they're running the default editor. I've tried installing typings and typescript using npm. I've Followed that tutorial to get Javascript intellisense for node.js, but I fail to get either error/warning checking or any type information for node.js modules.

Is there a location the type files should be installed to in order to make them global to every JS project you create in VS Code?

Ben
  • 1,816
  • 1
  • 20
  • 29

3 Answers3

0

OK, so I managed get get some code suggestions working after reading up online. Without using the whole Typings tools, I acquired node.d.ts (found it on my computer inside C:\Program Files (x86)\Microsoft VS Code\resources\app\extensions) and placed that in my project's directory structure inside the ".vscode" folder. At the top of my .js file I added the following line:

/// <reference path=".vscode/node.d.ts" />

The code seems to be recognized now. I read up on this tip here: How to Import Intellisense files into vsCode (Visual Studio Code)

Community
  • 1
  • 1
Hectate
  • 210
  • 2
  • 9
0

If you are using ESLint and you have an .eslint.js file in the project root you also need the eslint dependency installed in the project. Otherwise, if there is a .eslint.js file but the ESLint dependency is not installed Visual Studio Code will report nothing in the editor.

AxeEffect
  • 6,345
  • 4
  • 37
  • 33
-1

Maybe you didn't use the -g flag to install them globally? Alternately, perhaps it's a missing jsconfig.json file?

Hectate
  • 210
  • 2
  • 9
  • 1
    I did install with the -g flag and I do have a jsconfig.json file in my root directory. – Ben May 07 '16 at 14:39
  • Global installs to User/AppData/Roaming/npm/node_modules Is this correct? – Ben May 07 '16 at 14:42
  • Makes me wonder if it's working on my install (default everything I think), or if I'm just not noticing that it doesn't. – Hectate May 07 '16 at 14:50
  • Could you check for me and let me know? That'd be useful. Thanks. – Ben May 07 '16 at 14:54
  • Hrm, yeah so I skipped Intellisense/etc and the suggestions I get are based on my existing code. That seems to have been working well for me because I'm using only two libraries (irc and moment) so the calls are limited to a few simple things that are already in use in my code. Meanwhile the errors I've seen are just syntax things that I've introduced and the editor recognizes them. – Hectate May 07 '16 at 15:30
  • Also, my User/AppData/Roaming/npm/ folder is empty; but ../npm-cache/ is not, hah. – Hectate May 07 '16 at 15:32