Always starts from changing node_modules/
directly, for more complex use cases
🔰🔰🔰
/path/to/lib $ npm link
/path/to/app $ npm link lib
- creates global symlink
/path/to/app $ npm install /path/to/lib
- "@node-config": "2.0.22",
+ "@node-config": "file:../node-config",
- modifies
package.json
asfile:/path/to/lib
- creates local symlink
- runs preinstall/postinstall
Do
/path/to/lib $ npm pack | tail -n 1
before npm i <pkg>
and replace pkg
with the generated tarball(pkg-[version].tgz
) instead.
Summarized from https://medium.com/@the1mills/how-to-test-your-npm-module-without-publishing-it-every-5-minutes-1c4cb4b369be