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.
After upgrading from Nuxt 3 to Nuxt 4, the Docker build fails with the following errors during the
- Suggests removing
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: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 installThe 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.
