NPM link allows you to override where 📦 NPM gets a package from.
Steps
Warning
npm link
requires the versions of node to match.
- Navigate to the locally cloned repository for a dependency you want to add
- Note the name of the package in the
package.json
- Enter the command
npm link
- Navigate to the host application repository
- Enter the command
npm link <name-of-package>
At this point you will notice that the package that you linked will not be listed in the dependencies for the host app, but the package will appear as a symlink
within that projects node_modules
.