Search code examples
javascriptnode.jsintellij-ideawebstorm

Webstorm 7 cannot recognize node API methods


I just installed WebStorm. I'm working on a small Node.js app.

I've attached the Node.js source code, and when I click on the Node.js settings, I can see that it can recognize my various node modules, etc.

I'm having two issues:

  1. Unresolved variable or type: WebStorm doesn't seem to recognize simple API methods (exports, require).
  2. No code insight for…: If I call require('winston'), it tells me that it has no code insight. (Is there a way I can add the source code?)

Solution

  • For WebStorm 7 thru 10 (on OSX)…

    WebStorm → Preferences → Languages & Frameworks → Javascript → Libraries

    Select "Node.js Globals" and "Node.js vXXX Core Modules".