Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?)
like image 836
hba Avatar asked Oct 23 '13 04:10

hba


People also ask

Does WebStorm support Nodejs?

WebStorm lets you run and debug Node. js applications using Node. js on Windows Subsystem for Linux. You can choose Node.

How do I update node in WebStorm?

Enable Live EditPress Ctrl+Alt+S to open the IDE settings and select Build, Execution, Deployment | Debugger | Live Edit. Select Update Node.

Is IntelliJ good for node JS?

IntelliJ IDEA helps you run and debug your Node. js applications. You can debug applications that are started from IntelliJ IDEA as well as attach to already running applications.

How do I open a node project in IntelliJ?

In short, you have to go to Preferences -> Languages & Frameworks -> Node. js and NPM, and click Enable.


1 Answers

For 2018 and later versions of WebStorm:

In Settings -> Languages & Frameworks -> Node.js and NPM, check Coding assistance for Node.js:

WebStorm setting to enable Coding assistance for Node.js

In older Webstorm versions, this was called Enable Node.js Core library.

If you still see unrecognized Node symbols even with that option enabled, unckeck it, restart WebStorm, then right click on the warning and choose Enable Node.js coding assistance or just check the option again. Watch for WebStorm to show it's Indexing files. (Just had this happen today - looks like a WebStorm bug, and what I just wrote fixed the situation.)

like image 191
Dan Dascalescu Avatar answered Sep 22 '22 15:09

Dan Dascalescu