Deant
Deant

Reputation: 87

Using Node.Js Globals in WebStorm 2016

I recently upgraded to WebStorm 2016 from WebStorm 9 for debugging my NodeJS projects. But I cannot seem to find any option to enable NodeJS Globals like in WebStorm 9 (I can only enable NodeJS Core).

How can I enable NodeJS Globals and NodeJS Core in WebStorm 2016?

Upvotes: 3

Views: 1338

Answers (3)

M.Vanderlee
M.Vanderlee

Reputation: 3006

Try this:

File -> Invalidate Caches/Restart...

PS: You don't need to download the javascript libraries.

Upvotes: 0

Phil Holland
Phil Holland

Reputation: 31

This sounds like same problem I had (things like require() and exit() wouldn't resolve). Found this on the jetbrains support page and it worked for me:

"'Node.js Globals' library has been merged with 'Node.js Core Modules', and can be enabled in Settings/Languages & Frameworks/Node.js and NPM" https://intellij-support.jetbrains.com/hc/en-us/community/posts/206999855-Node-js-Globals-library-missing-from-10-0-1-?sort_by=votes

Upvotes: 3

lena
lena

Reputation: 93748

res.render is an Express framework method, it's not a part of Node.js core. You need to download the Typescript community stubs for express, express-serve-static-core and serve-static modules to get Express methods resolved: Settings | languages & Frameworks | javaScript | Libraries, press Download..., choose needed modules from the list

Upvotes: 3

Related Questions