Tags

How to Install NPM Packages Locally

Miguel Lima By Miguel Lima
Published on

Do you developed an npm package, and want to install it on your own projects? Install a local npm it is pretty straight forward.

You have two options, install the package or link it, I personally recommend link it, because this way every time you update the package, it will be updated in all projects you use the package. Otherwise you will have to manually update the package.

On open your npm project folder on terminal, and run:

npm link

Now open the project folder you want to use the package on terminal, and run:

npm link package-name

Where "package-name" is the name of your package.

Install Package

If you want to install the package, it is very simple. Open the project folder (that you want to install the package) in the terminal and run:

npm install /path/to-your-package

Learn something from this article?

We would love to share more content like this with you!

    We won't send you spam. Unsubscribe at any time.