質問

I am running a MEAN (MongoDB, Express, AngularJs, Nodejs) project in WebStorm IDE, i have included the required library files at time of starting my project.

After including the MongoDB connection, I need to include the Mongoose library in my project.

I have searched all the options given in the WebStorm IDE but I can't find the way.

Please tell me the way for including the library files in my project using WebStorm IDE.

役に立ちましたか?

解決

WebStorm opens the folder of your file system. Click on open and select your folder. In order to get mongoose library, navigate to your project folder in command prompt and, use

npm install mongoose

This will install mongoose in your node_modules folder. Then wherever you want to use mongoose, just say require("mongoose").

他のヒント

Altought I prefer to use the CLI as @Bhoomi pointed out, there is a way to do it directly from the IDE.

Just open Setting/Node.js and NPM, clic Install button and you will get a list of available packages, so just install one of them (mongoose in this case) and voilá, WebStorm installs the package right under node_modules in your project (if the folder isn't already there then is created).

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top