Install Local Modules Using npm-link
Step 1: Go to the local module directory ( package you want to install ) and enter this command.
npm link
Step 2: Go to the project directory where you want to install the local module and enter this command.
npm link package-name
Example: Let the local-dir is the local directory and project-dir is the project directory and local_module is the local module package you want to install, first go to the local-dir and type npm link and next go to the project directory and type npm link <local_module> this will link your local module to your project.
How to Install a Local Module Using npm?
This article shows how to install a local module using npm. Local modules are modules created locally in your Node JS application to create user-required functionality. These local modules include different functionalities of your application in separate files and folders. To link the local module first you must have the local module directory or package directory.
Table of Content
- Why do we use local modules?
- How to Install Local Modules?
- Install Local Modules Using npm-link;
- Install Local Module Using npm Install
- How to Uninstall a Package Installed with an npm link?
Before knowing how to install a local module using npm, let’s know why we use local modules.