Local NPM dependency in package.json not installing

I forked an NPM package and included it in the root directory of my source code (./dependencies/module-name)

I added in my package.json as:
“module-name”: “file:dependencies/module-name”

It works locally, but when deploying on Netlify, it doesn’t work and can’t find the module-name in the app.

Any ideas?

Thanks a lot!

Hiya @Migs86 and welcome to the community! Sorry it took us a few days to get back to you.

Could you check out this debugging guide, and at a minimum, answer the questions at the end? being able to see your build logs will be step one for our troubleshooting, once you’ve confirmed that things work locally from a clean copy of the repo, and that you’ve got the same versions configured here as you use locally:

Same problem here.
I had a local dependency (working 15 days ago) installed like:

// package.json
"@bit/my-component": "file:./bit/my-component"

But the build progress errors out:

Can't resolve '@bit/my-component' in file.js

It works locally and not in production. I did all the steps. It seems that the /node_modules folder does not have the package installed in build step.

Hey there, thanks for reaching out.

Can you give this a read through and let us know if that fixes the issue?

I (kind of) solved the issue.

The package was missing because the /dist folder was not present. So I had to remove the /dist folder from the .gitignore from one of the private npm packages.

But this is a workaround (Uploading the bundled resulting package from a private registry),

I cannot add the bit.dev private .npmrc. Even following these instructions.

Nor this instructions:

You could probably create the folder as part of your build command instead of committing it if the issue was only that it needs to exist.

With regards to your other issue, can you provide more information on what error you are running into when following the instructions you linked to? What does your .npmrc look like? Do you have a deploy link of this failing to deploy? Not knowing your results really prevent me from making any useful advice, at this time.

Let me know if you have any other questions.