-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
My solution to the NPM package-lock.json problem #22
Comments
Hi @BenJackGill thanks for looking into this! I hope to give the lockfile situation a closer look soon too. It's good to know that individual packages might be causing this. I think I might also have the functions test package as a dependency while not using it... |
I came up against this error again. This time the package causing the error was Here is an example of the full error I was seeing. You can see that it calls out
While this worked, it is not a great a solution for me because I do need to use I am still looking for a final solution. |
I'm hoping to revisit this in the coming months but I've been really busy with work. Personally, I've been just excluding the lock files. I consider my project dependencies stable enough, but of course, it could go wrong. It's a tradeoff I'm willing to live with. I'd rather do that than chasing and excluding packages at the moment. In the meantime, I've also been working on a monorepo setup example that showcases isolate-package, because a number of people have been asking me for help on that, and it's not trivial. I'll probably wrap that up first before I get to this... |
Posting our approach, as it might be useful. Note that we've only tested in a small test project, and that we bundle the shared dependencies instead of using We generate a |
@giacomoran Interesting. Care to share the commands you use for generating that lockfile specifically for the target package? From my shallow reading of the docs, it's not clear to me yet. |
Sure, from the target package directory:
|
@giacomoran I've been spending a lot of time on the lockfile situation recently. I'm mostly focusing on PNPM now, also because NPM was giving me some unhelpful errors in my test monorepo that were driving me nuts, but I would like to give it another try soon... I was wondering in your case how you are bundling your shared deps. Is it only your own shared code that gets included in the bundle, or are you also bundling code from any external NPM packages that the shared code depends on? If you are not bundling the dependencies of the shared dependencies, then I think Arborist is doing something that I'm still failing to implement with PNPM, because I managed to generate a valid PNPM lockfile, but the deps of my shared deps are not getting installed unfortunately... |
I'm bundling the dependencies of the shared dependencies, to keep things simple. If you want to take a look, I've created a small demo project showcasing our approach: https://github.com/giacomoran/demo-npm-bundle-local-deps |
@giacomoran Thanks for sharing! 👍 In the meantime, I'm also happy to report that it looks like I've almost solved the PNPM challenge, generating a lockfile specific for the isolated package based on the existing monorepo root lockfile. After that I will likely give Arborist another try. |
Happy to announce that NPM lockfile support has been added, based on Arborist. Thanks for bringing it under my attention @giacomoran I have also forked firebase tools to integrate isolate-package, so you can run the local emulators with live code updates. For more info see this thread firebase/firebase-tools#653 (comment) |
That's awesome! Thank you for your work. |
I encountered deployment issues with
npm
due to thepackage-lock.json
file.Console messages indicated missing packages within the
package-lock.json
. Though excluding this file from the configuration allowed for smooth deployment, I wanted to retain it.To identify the problematic package, I began removing packages individually. For me, the issue stemmed from
firebase-functions-test
—an old package I no longer utilized. After uninstalling it, the deployment went smoothly.If you're facing a similar issue, I recommend removing packages individually to identify the problematic one.
I hope future versions of
isolate-package
become universally compatible. Until then, this method might be a workaround.Lastly, if you pinpoint a problematic package, please share it here to aid others in faster troubleshooting!
The text was updated successfully, but these errors were encountered: