Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebStorm: Module is not listed in package.json dependencies

I have tried importing the NPM package Express into WebStorm to use it using the following method: https://www.jetbrains.com/webstorm/help/installing-and-removing-external-software-using-node-package-manager.html#d89772e236

Although I have followed the steps, when I use my code:

var express = require("express");
var url = require("url");
var http = require("http");
var app;...

It underlines express, with the following message: Module is not listed in package.json dependencies.

I do not have that much experience with WebStorm, so I do not know how to fix this. Would anyone care to explain?

like image 870
AppelDonut Avatar asked Dec 03 '15 19:12

AppelDonut


1 Answers

Put cursor on underlined word, hit Alt+Enter, choose 'Add 'express' to dependencies in package.json' (or 'Add 'express' to devDependencies in package.json' if you prefer to have it listed in dev dependencies)

like image 131
lena Avatar answered Sep 28 '22 05:09

lena