"Global" modules?

22 views
Skip to first unread message

O haya

unread,
Jan 17, 2017, 9:20:09 PM1/17/17
to nodejs
Hi,

I am working on a web app project where I use Express and also node-java.

The Express documentation indicates to create a directory for my app and then run the "npm install express --save" inside that directory.  Since my web app uses node-java, I then build gyp, java, and node-java under that directory.

However, I may have several apps, including this Express app, that will use node-java.  

Is there way to build the node-java stuff such that I can use node-java in multiple applications, without having to rebuild the node-java under each project?

Sorry if this is a kind of newbie question and also I wasn't sure if this question might be better in the Express group or here.

Thanks,
Jim

O haya

unread,
Jan 19, 2017, 5:17:28 PM1/19/17
to nodejs
Hi,

I found that if I just run "npm install xxx" while in the main Node.js directory, the modules would be created in a node_modules directory directly under the main Node.js directory, and then, I could use the modules from running node in any directory.
Reply all
Reply to author
Forward
0 new messages