node-sass: Can't find libsass in Docker image

Dockerfile

FROM node:0.12.2 // also tried CentOS 6.6

COPY . /src
WORKDIR /src
CMD cd ./src;
RUN npm install --loglevel error;
EXPOSE 3000

CMD ["npm", "run", "dev"]

package.json

  "scripts": {
    "start": "node bin/www",
    "predev": "gulp compile-sass",
    "dev": ". ./config/set-dev-env.sh; nodemon ./bin/www"
  },

docker

❯ docker run REDACTED                                                                                  01:24:16 PM

> REDACTED@0.0.0 predev /src
> gulp compile-sass

/src/node_modules/node-sass/lib/extensions.js:148
    throw new Error(['`libsass` bindings not found in ', binaryPath, '. Try re
          ^
Error: `libsass` bindings not found in /src/node_modules/node-sass/vendor/linux-x64-14/binding.node. Try reinstalling `node-sass`?
    at Object.sass.getBinaryPath (/src/node_modules/node-sass/lib/extensions.js:148:11)
    at Object.<anonymous> (/src/node_modules/node-sass/lib/index.js:16:36)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/src/node_modules/gulp-sass/index.js:157:21)
    at Module._compile (module.js:460:26)

npm ERR! Linux 4.0.3-boot2docker
npm ERR! argv "node" "/usr/local/bin/npm" "run" "dev"
npm ERR! node v0.12.2
npm ERR! npm  v2.9.1
npm ERR! code ELIFECYCLE
npm ERR! REDACTED@0.0.0 predev: `gulp compile-sass`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the REDACTED@0.0.0 predev script 'gulp compile-sass'.
npm ERR! This is most likely a problem with the REDACTED package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     gulp compile-sass
npm ERR! You can get their info via:
npm ERR!     npm owner ls REDACTED
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /src/npm-debug.log

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 23 (7 by maintainers)

Commits related to this issue

Most upvoted comments

the solution is to install with --unsafe-perm.

npm --unsafe-perm install

see https://github.com/nodejs/docker-node/issues/88