Test NPM package with Netlify without republishing NPM package

We are building an npm package and we are trying to test it on a server. We have built a minimal cra app that requires our package. For some reason, the app works on localhost but fails on a Netlify server.

My question is: How can we test the npm package? We could redeploy the npm package and try again but that is obviously undesirable. We want to test locally without republishing the npm package.

I have tried to use “npm link” but that does did not work because the project is rebuilt with the package on npm. When I installed the package from a file I got the warning

5:52:51 PM: error Package "bitcoin-computer" refers to a non-existing file '"/opt/build/bitcoin-computer"'.

What is the recommended way to test an NPM package on Netlify locally? Many Thanks!

Hi @clemens, welcome to the community!

Have you tried following the guide here: [Support Guide] Using private NPM modules on Netlify? It’s not exactly your issue but may help.

Let me know how it goes.