How to Install Local NPM Packages
1 min read

How to Install Local NPM Packages

You've created a package that suits your needs. And now, you want to use it on your project.

You have two options. Install the package direcly 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.

Link Package

Open your npm package project folder on terminal, and run:

npm link

Next open the project folder you want to install the package, 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

Enjoying these posts? Subscribe for more