DEV Community

Discussion on: How to test your NPM package locally

Collapse
 
iamandrewluca profile image
Andrei Luca • Edited

I have to mention again, that this is a specific use case when you use npm link

Unfortunately that's true. NPM is just a package manager, install/uninstall dependencies. Node is the one who resolves dependencies.

nodejs.org/api/modules.html#module...

Smart enough should be the bundler to know what exactly to load.

github.com/iamandrewluca/example-n...

cd npm-calculator
npm install
cd ../npm-calculator-test
npm install
node index.js
Enter fullscreen mode Exit fullscreen mode
17.0.2
16.14.0
Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
jackmellis profile image
Jack

I mentioned it in another comment but in my experience, npmjs.com/package/yalc solves all of these kind of issues. It's so useful