Skip to content
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

using turborepo / monorepo and npm #551

Open
mdroidian opened this issue Jan 9, 2025 · 0 comments
Open

using turborepo / monorepo and npm #551

mdroidian opened this issue Jan 9, 2025 · 0 comments

Comments

@mdroidian
Copy link

Does patch-package support turborepo / monorepo using npm?

My repo has a similar structure to: https://github.com/vercel/turborepo/blob/main/examples/basic/README.md

Namely, each app / package (workspace) has a package.json but no package-lock.json, which gives me an error when trying to patch.

Steps to Repo

  • navigate to workspace
    cd apps/myApp
  • install patch-package
    npm i patch-package --save-dev
  • fix a bug in one of your dependencies
    vim node_modules/some-package/brokenFile.js
  • run patch-package to create a .patch file
    npx patch-package some-package
Creating temporary folder
Error: Can't find yarn.lock file

It is throwing this error because it cannot find the package-lock.json in the workspace directory, so it assumes yarn.

const packageLockExists = fs.existsSync(
join(appRootPath, "package-lock.json"),

Patch Package in root

The package/file I want to patch is located in the node_modules of the app / package (workspace).

apps/myApp/nod_modules/some-package

Is it possible to target that via npx patch-package some-package when running in the root directory?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant