Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enabling autocompletion in WebStorm for node.js modules installed via npm

I am using WebStorm 5.0.4 to develop a node.js app.

I installed several node modules globally using

npm install -g module-name
and linked them into the project using
npm link module-name

Autocompletion does not work for any of the npm installed modules. It only works for core modules (e.g. http or path).

Furthermore, WebStorm gives a warning "Unresolved function or method xyz" for any of the functions I call from npm installed modules.

How do I make WebStorm autocomplete and generally become aware of the installed modules that I require?

like image 612
midinastasurazz Avatar asked Dec 13 '12 14:12

midinastasurazz


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.

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.


1 Answers

I'm not sure if this accounts for your particular situation, however I ran into a similar issue in WebStorm 5.0.4, whereas anything that was required was not auto-completing. I was able to resolve this issue by going into my Project Settings, navigating to JavaScript | Libraries, checking "Node.js Core Modules" and "Node.js Globals", and clicking apply.

like image 86
Richard Cesar Avatar answered Oct 03 '22 00:10

Richard Cesar