-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
npm ci with esbuild on different systems #3813
Comments
This is easy to verify since many projects on GitHub has actions running Therefore, you should check if anything is different on Windows and on your linux docker container. For example the package-lock.json - lockfileVersion. Also you can try to install your project without the lockfile (or just run |
That’s very unfortunate. It sounds like a bug with npm. I looked through npm’s issue tracker and found npm/cli#4828, which sounds like what you’re encountering. I wasn’t aware of this problem already. It sounds like it affects all tools that distribute native components (including swc and rollup, not just esbuild). I’m not sure what to do about this. I read through the comments on that issue and it doesn’t seem like anyone from the npm team acknowledged the issue or indicated a willingness to fix it. Using another package manager without the bug may avoid this issue (e.g. Yarn has dedicated features for multi-platform packages). But if npm itself (the canonical JavaScript package manager) has trouble with esbuild’s current package distribution strategy and is unlikely to fix their bugs, then esbuild may need a new package installation strategy. Or I somehow need to get npm fixed myself I suppose. Hmm… |
That's weird because I just tried that on my Windows machine and it generates correct lockfile… So as far as I can tell from that npm cli issue, this problem occurs with:
|
Just for documentation purposes here my version
Checked again no node_modules folder present |
Found a (dirty) workaround for now
|
IIRC this npm bug only happens when there's already a lockfile; if you remove it and node_modules, then install again, you should see all of the missing deps appear. |
Preconditions
We are using windows during development and linux docker for building.
node_modules folder is not committed...
When I now have esbuild as dependency in my project I install the deps and get
Now package-lock.json is generated
Issue
We are now in linux docker container
We install there the deps with
npm ci
Then we get the following message
The text was updated successfully, but these errors were encountered: