Skip to content

Instantly share code, notes, and snippets.

@x-yuri

x-yuri/a.md Secret

Last active February 15, 2023 02:30
Show Gist options
  • Save x-yuri/97f2fe1bb06884802b9b2e4621cd94ee to your computer and use it in GitHub Desktop.
Save x-yuri/97f2fe1bb06884802b9b2e4621cd94ee to your computer and use it in GitHub Desktop.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment