Dockerfile
:
FROM node:18 AS node_modules
WORKDIR /app
RUN npm install [email protected]
FROM node:18-alpine
WORKDIR /app
COPY --from=node_modules /app/node_modules /app/node_modules
RUN node_modules/.bin/node-sass --version
$ docker build .
...
Step 7/7 : RUN node_modules/.bin/node-sass --version
---> Running in edb57db4ae8b
/app/node_modules/node-sass/lib/binding.js:15
throw new Error(errors.missingBinary());
^
Error: Missing binding /app/node_modules/node-sass/vendor/linux_musl-x64-108/binding.node
Node Sass could not find a binding for your current environment: Linux/musl 64-bit with Node.js 18.x
Found bindings for the following environments:
- OS X 64-bit with Node.js 18.x
- OS X 64-bit with Node.js 19.x
- OS X 64-bit with Node.js 16.x
- Linux 64-bit with Node.js 18.x
This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to download the binding for your current environment.
at module.exports (/app/node_modules/node-sass/lib/binding.js:15:13)
at Object.<anonymous> (/app/node_modules/node-sass/lib/index.js:13:35)
at Module._compile (node:internal/modules/cjs/loader:1218:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1272:10)
at Module.load (node:internal/modules/cjs/loader:1081:32)
at Module._load (node:internal/modules/cjs/loader:922:12)
at Module.require (node:internal/modules/cjs/loader:1105:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object.<anonymous> (/app/node_modules/node-sass/bin/node-sass:10:10)
at Module._compile (node:internal/modules/cjs/loader:1218:14)
Node.js v18.13.0
The command '/bin/sh -c node_modules/.bin/node-sass --version' returned a non-zero code: 1