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 c
Updating to Webstorm 8 or higher will fix your require methods problem. As posted earlier by checking if Settings > JavaScript > Libraries > Node.js are all checked will fix your problem
For 2018 and later versions of WebStorm:
In Settings -> Languages & Frameworks -> Node.js and NPM, check 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.)
I use WebStorm 2020 and I had everything enabled but WebStill though showed that module.exports
is unknown function. Then I turned off NodeJS.core library and NodeJS code assistance, applied and then turned them on again. And suddenly it started to work.
As I've answered on the WebStorm says console is an unresolved variable question, to solve these problems on the new Webstorm versions, you need to enable the Coding assistance for Node.js.
To do this, go on the Settings
> Languages & Frameworks
> Node.js and NPM
and click on the Coding assistance for Node.js
option, and then click OK to save:
This will all Node.js unresolved variables and functions.
On the new Webstorm versions, just going above error and clicking in More Actions...
(or ALT+ENTER) and selecting
Enable Node.js coding assistance will solve this.
For WebStorm 7 thru 10 (on OSX)…
WebStorm → Preferences → Languages & Frameworks → Javascript → Libraries
Select "Node.js Globals" and "Node.js vXXX Core Modules".