-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Cross-platform package-lock.json #1335
Comments
npm as an ecosystem does poorly with architecture/OS as it isn't a core part of the functionality. It has been an issue since forever. npm/npm#17722 That Turborepo is abusing I have two workarounds for you:
As for patching, we could attempt to patch a lockfile from This is certainly possible, but it is not a high priority task for us at this time. |
Had issues with using dev dependencies in my build scripts too. Could only solve them by migrating from |
You can also run npm install on both mac and linux—the key is keeping the same lockfile. A non-recommended way would be to install the turbo dependencies specifically, e.g. turbo-linux-64 |
Related #1126 |
Related #3317 |
Closing and locking this. If you encounter this after following steps in this and linked issues, please file a new issue! |
What version of Turborepo are you using?
1.2.16
What package manager are you using / does the bug impact?
npm
What operating system are you using?
Linux, MacOS
Describe the Bug
NPM has problems with lockfiles with platform-specific optional dependencies.
Simply put,
npm install
on macOS vs Linux generates differentpackage.json
files.This issue affects a small subset of platform-specific optional packages, e.g.
fsevents
,@next/swc-<platform>
, andturbo-<platform>
.I want turbo to automatically detect and patch my package-lock.json file, like
@next/swc
does. See:Unfortunately, this issue has plagued npm for a while:
package-lock.json
when reinstalling withnode_modules
present npm/cli#4828Expected Behavior
npm ci --include=dev --include=optional --include=peer
withturbo
works regardless of which operating systemnpm install
is run on.To Reproduce
npm install
in a turbo monorepo to generate apackage-lock.json
filenpm ci --include=dev --include=optional --include=peer
in a turbo monorepo and try runningnpx turbo
The workaround is to run
npm install
on every platform you run your project, every time you regenerate thepackage-lock.json
The text was updated successfully, but these errors were encountered: