How to Install NPM Packages Locally
- 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:
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.
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