Skip to content

Shrinkwrap + npm bug + rollup's os-specific subpackages make it impossible to npm ci when using netlify-cli as a local dependency #7769

Closed

Description

@angelikatyborska

Describe the bug

I have just started migrating my Astro projects from Vercel to Netlify and I hit this bug that I'm unsure how to handle.

Prerequisites for triggering the bug

  • I use npm as a package manager in my project
  • I installed netlify-cli in my project as a local dependency
  • netlify-cli has a shrinkwrap file
  • netlify-cli depends on rollup, which depends on os-specific packages like @rollup/rollup-android-arm-eabi, @rollup/rollup-android-arm64, and so on.

The bug

I am unable to run npm ci after adding netlify-cli to my project. It crashes with the following error:

$ npm ci
11.2.0
npm error code EBADPLATFORM
npm error notsup Unsupported platform for @rollup/[email protected]: wanted {"os":"android","cpu":"arm"} (current: {"os":"darwin","cpu":"arm64"})
npm error notsup Valid os:   android
npm error notsup Actual os:  darwin
npm error notsup Valid cpu:  arm
npm error notsup Actual cpu: arm64
npm error A complete log of this run can be found in: /Users/angelikacathor/.npm/_logs/2025-11-10T14_51_35_010Z-debug-0.log

I created a very simple repository to reproduce the bug, see "steps to reproduce".

The underlying cause has been reported to npm (npm/cli#7622), but they don't seem to be in hurry to fix it (reported over a year ago).

My assumptions

  • npm is a widely-used package manager so Netlify would want to fully support it.
  • Installing netlify-cli as a local dependency is supported because the docs suggest doing so.
  • Running npm ci instead of npm install is a good practice because it only installs exactly the dependencies and versions listed in the lock file.

Solutions?

Does anyone else out here experience the same problem? I didn't see it reported yet.

Can Netlify do anything to help?

I understand that technically npm should fix the underlying cause, but they aren't doing it. Could you somehow create a second version of the netlify-cli package meant for local installations that doesn't have a shrinkwrap file? I saw that there were other complaints about the shrinkwrap. Or maybe there is a way to get rid of those os-specific rollup packages from the shrinkwrap without affecting any functionality? Or maybe at least the documentation should be appended to warn about this problem and how to work around it? Assuming I'm not the only one that this happens to.

Possible workarounds?

I could see a few possible workarounds on my side, but all of them are potentially disrupting:

  • Switch to a different package manager
    • Not great because it's lot of work, many of my projects are affected, might bring about other bugs and limitations.
  • Switch to using netlify-cli globally
    • Not great because I will lose the ability to ensure that each team member and the CI are running the same version.
  • Give up on using npm ci
    • Not great because it will make CI runs less useful for catching problems early, and make deployments more risky.

Did anyone else try any of those workarounds? Am I missing something? Any advice would be appreciated!

Steps to reproduce

  1. Clone the repository https://github.com/angelikatyborska/netlify-cli-test
  2. Open a terminal, navigate to the repository, and run npm ci

Configuration

No response

Environment

System:
OS: macOS 26.1
CPU: (11) arm64 Apple M3 Pro
Memory: 91.16 MB / 18.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.14.0 - /Users/angelikacathor/.asdf/installs/nodejs/22.14.0/bin/node
npm: 11.2.0 - /Users/angelikacathor/.asdf/plugins/nodejs/shims/npm
pnpm: 10.12.4 - /Users/angelikacathor/Library/pnpm/pnpm
bun: 1.2.15 - /Users/angelikacathor/.bun/bin/bun

Activity

  1. added
    type: bug
    on Nov 10, 2025
  2. taylorreece commented on Nov 13, 2025

    @taylorreece
    Contributor

    I just ran into this on the latest netlify-cli version, too. https://github.com/prismatic-io/embedded-workflow-builder-docs/actions/runs/19334870655/job/55306967240?pr=10

    I ended up removing netlify-cli from my dev dependencies and opted to install it with --global instead. prismatic-io/embedded-workflow-builder-docs@e19a8fb

    I guess that's fine for now? Dependabot can't track it, which stinks, but I'll just keep an eye on this repo instead.

  3. serhalp commented on Nov 13, 2025

    @serhalp
    Member

    Oof, this is a weird one.

    It seems nothing actually changed in netlify-cli itself here that would cause this. As evidence, here's the diff from 23.9.5 to 23.11.0 — the same bump as in @taylorreece's PR. There are no relevant changes to android packages.

    It's in @taylorreece's bump PR itself that the optional: true android (etc.) native packages get erroneously changed to extraneous: true, resulting in the... also erroneous npm validation triggering 😓.

    Interestingly, we only have these two reports of this occurring. I'm not sure what the exact necessary conditions are or how widespread this is.

    As a workaround, you could perhaps use pnpm? or npm install instead of npm ci?

  4. added theissue type on Nov 13, 2025
  5. G-Rath commented on Nov 13, 2025

    @G-Rath

    Using npm install is not the worst short-term workaround, but just want to highlight:

    • its not reasonable to switch to a whole different package manager as a workaround, unless you're actively not supporting the package manager this is breaking on
    • npm ci provides assurances that npm install does not i.e. immutable installing

    Both of these are important aspects to security and compliance

  6. serhalp commented on Nov 13, 2025

    @serhalp
    Member

    Of course, I was just brainstorming workarounds for this NPM CLI bug — as far as I can tell it is not an issue with the Netlify CLI.

    By the way @G-Rath are you also experiencing this? That would be a third report. Do you have any information about when this was introduced for you? in a particular version of netlify-cli? or of npm?

  7. G-Rath commented on Nov 13, 2025

    @G-Rath

    Yes I am, in trying to update from v23.5.1 to v23.11.0*.

    Give me a few minutes and I'll get you some details

    *: I just realised a version was released 4 hours ago, so actually when I posted my comment on the other issue I was upgrading to v23.10.0, so I can now say that this isn't fixed in v23.11.0

  8. G-Rath commented on Nov 13, 2025

    @G-Rath

    So we do npm ci in our CI, so while we've not used every individual version of the cli, I can say we've used a number of them (updating to address security patches, cause shrinkwrap) and this is the first time we've seen this issue.

    For NPM versions, again I've not tried every exact version but doing the majors it looks to happen all the way back to v9 - I have produced it on:

    • 11.2.0
    • 11.0.0
    • 10.9.3
    • 10.0.0
    • 9.9.4
    • 9.0.0
  9. G-Rath commented on Nov 13, 2025

    @G-Rath

    ok looks like this was introduced in v23.10.0 - I just tested the versions between 23.5.1 and 23.11.0, and it starts happening on 23.10.0

  10. serhalp commented on Nov 13, 2025

    @serhalp
    Member

    Those are fantastic details, thank you @G-Rath! We'll take a closer look.

  11. Ari-Kishon commented on Nov 23, 2025

    @Ari-Kishon

    Just wanted to bump and say this happened to us aswell,

    Would love to get notified when this is fixed, for now im pinning my version to 23.9.5

  12. philiprenich commented on Nov 24, 2025

    @philiprenich

    Throwing in another data point that I've had this happen as well, rolling back to [email protected] solved it for me. Thanks @G-Rath for that info!

  13. serhalp commented on Nov 24, 2025

    @serhalp
    Member

    Thanks, folks. FYI, we are actively looking into this issue. Please hold!

  14. serhalp commented on Nov 27, 2025

    @serhalp
    Member

    This is now fixed in [email protected]. Thank you all for your help and patience!

  15. angelikatyborska commented on Nov 27, 2025

    @angelikatyborska
    Author

    Thank you for fixing the bug 🙌 I admit I lost my patience after two days and decided to migrate to pnpm after all 😅 (it was not the first npm bug that bit me).

  16. rfricz commented on Feb 24, 2026

    @rfricz

    I still get

    npm error code EBADPLATFORM
    npm error notsup Unsupported platform for @rollup/[email protected]: wanted {"os":"android","cpu":"arm"} (current: {"os":"win32","cpu":"x64"})
    

    when I run npm ci with netlify-cli 23.15.1, node.js 24.13.1 and npm 11.8.0 on Windows 11. I tried to use netlify-cli 22.4.0, 23.9.5 and 23.12.1 but get the error regardless of netlify-cli version. I also get the error with node:24 image in docker.

    This is a blocker that makes reproducible builds that rely on npm ci impossible, could this issue be reopened please?

  17. assigned and unassigned on Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions