Need help on Node modules

49 views
Skip to first unread message

Srisowrabha Kumar

unread,
Mar 28, 2018, 9:40:13 AM3/28/18
to nodejs
Hi all,

I am new to Node and need help on collecting all files/folders related to a node module. The agenda is to save a particular version on a local repository. The normal npm install grabs the version from NPM repo. However, I need in such a way that I can pull/copy the module from my local repo and paste the files/folders to the required destination. Kindly suggest.

Thank you,
Sowrabha

Mikkel Wilson

unread,
Mar 28, 2018, 8:34:11 PM3/28/18
to nodejs
All the dependencies/modules for a node project are in the ./node_modules directory. If you copy this directory to a different project all the dependencies will stay in tact. However, be advised that the origin environment and destination environment must match quite closely. Changes to the OS, architecture, node version, etc. can break many commonly used modules. NPM will take care of this for you so it is recommended.

If you are building a library and trying to share it outside of NPM, you might consider npm-pack.

HTH,
Mikkel
Reply all
Reply to author
Forward
0 new messages