How TO install a local module using npm

0 votes
I have a downloaded module repo, I want to install it locally, not globally in another directory?

What is an easy way to do this?
Jul 13, 2020 in Node-js by kartik
• 37,520 points
923 views

1 answer to this question.

0 votes

Hello @kartik,

In the local module directory:

$ cd ./package-dir
$ npm link

In the directory of the project to use the module:

$ cd ./project-dir
$ npm link package-name

Or in one go using relative paths:

$ cd ./project-dir
$ npm link ../package-dir

This is equivalent to using two commands above .

Hope it helps!!
Thank you!!

answered Jul 13, 2020 by Niroj
• 82,840 points

Related Questions In Node-js

0 votes
0 answers

How to install a private NPM module without my own registry?

I've taken some code and put it in ...READ MORE

Jul 13, 2020 in Node-js by kartik
• 37,520 points
1,571 views
0 votes
1 answer

How to install a private NPM module without my own registry?

Hello @kartik, Try: cd somedir npm install . or npm install path/to/somedir somedir must ...READ MORE

answered Jul 20, 2020 in Node-js by Niroj
• 82,840 points
794 views
0 votes
1 answer

How to npm install to a specified directory?

Hello @kartik, You can use the --prefix option: mkdir -p ./install/here/node_modules npm ...READ MORE

answered Jul 15, 2020 in Node-js by Niroj
• 82,840 points
7,415 views
0 votes
0 answers

How to install NodeJS LTS on Windows as a local user (without admin rights)

I'm using Windows as a simple user ...READ MORE

Aug 11, 2022 in Node-js by Neha
• 9,020 points
1,795 views
0 votes
1 answer

How to write files in Node.js?

Hello @kartik, Currently there are three ways to ...READ MORE

answered Jul 8, 2020 in Node-js by Niroj
• 82,840 points
908 views
0 votes
1 answer

How to install a previous exact version of a NPM package?

Hello @kartik, If you have to install an ...READ MORE

answered Jul 8, 2020 in Node-js by Niroj
• 82,840 points
2,796 views
0 votes
1 answer

How to run Gulp tasks sequentially one after the other?

Hello @kartik, By default, gulp runs tasks simultaneously, ...READ MORE

answered Jul 12, 2020 in Node-js by Niroj
• 82,840 points
1,484 views
0 votes
1 answer

How to set environment variables from within package.json?

Hello @kartik, Set the environment variable in the ...READ MORE

answered Jul 13, 2020 in Node-js by Niroj
• 82,840 points
23,951 views
0 votes
1 answer

How to Install a local module using npm?

Hello @kartik, This is what worked for me: npm ...READ MORE

answered Jul 9, 2020 in Node-js by Niroj
• 82,840 points
9,794 views
0 votes
1 answer

How do I install a module globally using npm?

Hello @kartik, I found the output contained the ...READ MORE

answered Jul 16, 2020 in Node-js by Niroj
• 82,840 points
792 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP