Search code examples
node.jsdockernode-sass

Error with node-sass when I use the latest node:stretch docker image


Starting from today, my builds started failing with errors related with node-sass.

After some research, I found the docker image was trying to find some binding.node that doesn't exist in the node-sass GitHub repository.

After a lot of failures, I realized the docker image I was using, was node:stretch and this image was updated 13 hours ago.

I tried to change to the previous version, node:11.14.0-stretch and the error is gone.

I know I fixed the problem for now, but was this the right procedure? Was there anything else I could do?


Solution

  • node-sass 4.12 has been released with support for Node 12. Because it is a binary module, it needs to recompile new bindings when new releases of Node are released. Pinning to "latest" or a non-specified version of the image can cause this to happen with a new Node release is made (which you figured out by re-pinning to a particular version).