I'm trying to updated (fool me) a node project built with nuxt and prepare a DockerFile and respective docker compose for it.
The build runs fine, but when execute docker-compose up this is the error:
e_nuxt-web-1 | Error: Missing binding /app/node_modules/node-sass/vendor/linux-x64-72/binding.node
e_nuxt-web-1 | Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 12.x
e_nuxt-web-1 |
e_nuxt-web-1 | Found bindings for the following environments:
e_nuxt-web-1 | - OS X 64-bit with Unsupported runtime (102)
e_nuxt-web-1 | - OS X 64-bit with Node.js 12.x
This is the DockerFile:
FROM node:12.18.0
WORKDIR /app
COPY . .
RUN apt-get update || : && apt-get install -y \
python \
build-essential
RUN npm install
RUN npm install typescript
RUN npm rebuild node-sass --force
ENV HOST 0.0.0.0
EXPOSE 3000
CMD [ "npm", "run", "dev" ]
dockercompose.yml
version: "3.4"
services:
web:
build: .
ports:
- "3000:3000"
volumes:
- .:/app
As you see I'm installing some missing parts to the node image (is there a better starting image for node projects?) and then trying to rebuild node-sass because this finding: Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime (88)
But as you see the error says the binding was built with "OS X", where the running container is Linux. Apparently this rebuild --force doesn't do what I expect, how should I force to rebuild the library for the proper OS?
Updating nuxt is a nightmare so I'd like to recreate the expected running environment for that version of nuxt which uses node-sass ^4.14.1 (which works with node12). While delving a bit more I see some suggestions about deleting the node-sass folder inside node-modules, why would that even make a difference?