KS on how to install a local package
MIT License
This is a demo repository to show different alternatives on how we can install a local package and publish it locally so it can be installed on another project without having to publish it at npm to test it.
The demo consists of two repositories:
This npm command creates a symlink to a package folder.
Package linking is a two-step process:
First, npm link
in a package folder will create a symlink in the global folder {prefix}/lib/node_modules/<package>
that links to the package where the npm link command was executed. It will also link any bins in the package to {prefix}/bin/{name}
.
Next, in some other location, npm link package-name
will create a symbolic link from globally-installed package-name to node_modules/
of the current folder.
In our case, we need to run these commands when located in the roor folder of this repository to be able to use the local package:
npm link @ks/my-local-package # link-install the package
Take a look at the following image, where we can see that after running npm link @ks/my-local-package
we can find in the node_modules
folder a symlink to the local package:
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!