NuxtN
Nuxt7mo ago
10 replies
AlexVeeBee

Build Failure After Upgrading from Nuxt 3 to Nuxt 4 in Docker (Linux) – Rollup Module Error

I’m encountering a build failure after upgrading my project from Nuxt 3 to Nuxt 4 when building in a Linux-based Docker environment. The project was building successfully with Nuxt 3, but after the upgrade to Nuxt 4, I’m seeing errors related to Rollup and native bindings. I need help identifying the root cause and finding a solution to successfully build my Nuxt 4 project in Docker.

Issue Description


After upgrading from Nuxt 3 to Nuxt 4, the Docker build fails with the following errors during the
npm install
step, specifically when running nuxt prepare:

Cannot find module '@rollup/rollup-linux-x64-musl'
Related cause: Cannot find module './parser.linux-x64-gnu.node'
Additional error message: Failed to load native binding


Error Suggestion:

- Indicates a potential npm bug with optional dependencies (referencing npm/cli#4828)
- Suggests removing package-lock.json and
node_modules
before retrying
npm install


The build process works fine on my local Windows machine (Node.js v22.17.0), but fails consistently in the Docker environment (Linux-based, using node:22.17.0-alpine).
GitHub
the package manager for JavaScript. Contribute to npm/cli development by creating an account on GitHub.
npm/cli
Was this page helpful?