I always use the latest Node.js image with alpine OS (node:alpine) to build Node.js application. But the application got this error “Node Sass could not find a binding for your current environment: Linux with Node 12.x. Found bindings for the following environment: Linux x64 with Node 10.x”. So I just change docker image from node:alpine to node:10-alpine, but still got the same error.
After googling I read the post that node-sass need the python to compile it modules. And after several trial & error, I got it working using the nikolaik/python-nodejs. Today, I just trying to copy application folder, change image & container name, create application using node:10-alpine, and it’s working!.
The solution was simply remove your old images and container, docker rmi node:alpine && docker rm yournodeapplication
. I don’t know why, but I think it was a cache problem from older container/image