Error: Cannot find module @rollup/rollup-linux-x64-gnu on Docker container #15532
Replies: 12 comments 15 replies
-
Start a new pull request in StackBlitz Codeflow. |
Beta Was this translation helpful? Give feedback.
-
If i try yarn rollup fixing but esbuild giving error :D
|
Beta Was this translation helpful? Give feedback.
-
Hi- Has anyone started working on this issue? |
Beta Was this translation helpful? Give feedback.
-
@Lymah123 You can change package manager to yarn and this line add to package.json
and for vite.config.js you can try this
Can you confirm is works or not for you? |
Beta Was this translation helpful? Give feedback.
-
Hi @BeycanDeveloper, sorry for the late response. I will check it out and let you know. |
Beta Was this translation helpful? Give feedback.
-
This is happening because you are mounting the local node_modules (containing the Windows binaries) on the container. You need to use the node_modules inside the Docker image or run For example, use a named volume and run version: '3'
services:
node:
build:
context: .
ports:
- "3035:3000"
volumes:
- ./:/usr/src/app
- node_modules:/usr/src/app/node_modules
volumes:
node_modules: |
Beta Was this translation helpful? Give feedback.
-
Add the code as below to
|
Beta Was this translation helpful? Give feedback.
-
I executed following command to install mentioned package as optional dependency for NPM and it solved the issue on my Ubuntu Linux local and Docker Image using Github Actions as well. I was facing this issue on latest Vite v5.1.3.
|
Beta Was this translation helpful? Give feedback.
-
this is weird, I don't have this issue on my another project, but
thankyou @viral-antuit |
Beta Was this translation helpful? Give feedback.
-
I had to use below code in package.json file and remove node_modules folder and run npm install. "overrides": {
"vite": {
"rollup": "npm:@rollup/wasm-node"
}
} I had to run below commands for dockerized app where docker compose run [service-name] npm i && \
docker compose down && \
rm -rf node_modules && \
docker compose up --build |
Beta Was this translation helpful? Give feedback.
-
For me I am using SvelteKit and I had to reinstall my adapter.
then
J |
Beta Was this translation helpful? Give feedback.
-
In my setup, similar issue got fixed by downgrading Vite to |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
I researched and tried on the sites below and on many different platforms, but I could not find a solution. I am using node:lts and also I cannot download this module in my docker container due to system incompatibility.
So I honestly don't know what to do right now.
#15120
rollup/rollup#5194
#15167
Reproduction
https://stackblitz.com/edit/vite-yxshfw?file=docker-compose.yml,package.json
Steps to reproduce
No response
System Info
Used Package Manager
npm
Logs
Validations
Beta Was this translation helpful? Give feedback.
All reactions