How to resolve and fix Unresolved function variable or method warning for node.js in JetBrains Webstorm 2018



If you have started programming in Node.js in JetBrains WebStorm 2018, you might have noticed the below warning in Jetbrains Webstorm 2018.

  • Unresolved Function or method warning
    Jetbrains Webstorm - Node.js Unresolved Function or Method warning

    Jetbrains Webstorm – Node.js Unresolved Function or Method warning

  • Unresolved Variable or Type warning
  • Jetbrains Webstorm - Node.js - Unresolved Variable or type warning

    Jetbrains Webstorm – Node.js – Unresolved Variable or type warning

Configuring JavaScript Libraries

In WebStorm, the library is a file or set of files whose functions and methods are added to WebStorm’s internal data in addition to the functions and methods that WebStorm retrieves from the project code to be edited. By default, its libraries are write-protected within the project.

WebStorm uses libraries only to improve coding assistance (example, code execution, syntax highlighting, navigation and documentation search). Note that the Library is not a way to manage project dependencies.

Configure Node.js Library

The issue can be resolved by configuring the Node.js library

  1. Enable code assistance for Node.js
  2. Go to: File -> Settings -> Languages and Frameworks -> Node.js and NPM
    Check the box for Code Assistance for Node.js as shown in the below screenshot.

    Jetbrains Webstorm - Settings  - Enable code assistance for nodejs and NPM

    Jetbrains Webstorm – Settings – Enable code assistance for nodejs and NPM

  3. Enable core libraries for Node.js core
  4. Go to: File -> Settings -> Languages and Frameworks -> Javascript ->Libraries
    Check the box for Node.js core as shown in the below screenshot.

    Jetbrains Webstorm - Settings - Enable Node.js core libraries

    Jetbrains Webstorm – Settings – Enable Node.js core libraries

  5. Click OK to save the settings

You will see the warning go away from the IDE editor screen as shown below. Now you will see code assistance will also work correctly.

Jetbrains Webstorm Editor Window

Jetbrains Webstorm Editor Window

Thanks for visiting my blog!!!

Previous Post:

Next Post:

In Category: IDE




Latest Posts

Underneath a boring IT professional lies a passionate student of computer science. I love computers and this blog is about everyday computer issues that a common man faces. Through this blog I try to reconnect with my long forgotten self.

Show 0 Comments
No comments yet. Be the first.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.