Hello World

Be Happy!

Error: Missing binding ...linux-x64-72/binding.node


web_1      | [Webpacker] Compiling...
web_1      | [Webpacker] Compilation failed:
web_1      | Hash: 9b6388925dc09cc92dcb
web_1      | Version: webpack 4.44.2
web_1      | Time: 9093ms
web_1      | Built at: 11/28/2020 5:57:44 AM
web_1      |                                         Asset        Size          Chunks                         Chunk Names
web_1      |        js/application-eccfea3aae96a90dd63c.js      14 KiB     application  [emitted] [immutable]  application
web_1      |    js/application-eccfea3aae96a90dd63c.js.map    12.7 KiB     application  [emitted] [dev]        application
web_1      |              js/bulma-d40240f8724790543ab9.js    4.62 KiB           bulma  [emitted] [immutable]  bulma
web_1      |          js/bulma-d40240f8724790543ab9.js.map    4.44 KiB           bulma  [emitted] [dev]        bulma
web_1      |     js/direct_uploads-ade31f5a3390594b603b.js    5.76 KiB  direct_uploads  [emitted] [immutable]  direct_uploads
web_1      | js/direct_uploads-ade31f5a3390594b603b.js.map    5.58 KiB  direct_uploads  [emitted] [dev]        direct_uploads
web_1      |                                 manifest.json  1020 bytes                  [emitted]              
web_1      | Entrypoint application = js/application-eccfea3aae96a90dd63c.js js/application-eccfea3aae96a90dd63c.js.map
web_1      | Entrypoint bulma = js/bulma-d40240f8724790543ab9.js js/bulma-d40240f8724790543ab9.js.map
web_1      | Entrypoint direct_uploads = js/direct_uploads-ade31f5a3390594b603b.js js/direct_uploads-ade31f5a3390594b603b.js.map
web_1      | [./app/javascript/packs/application.scss] 664 bytes {application} [built]
web_1      | [./app/javascript/packs/bulma.js] 773 bytes {bulma} [built]
web_1      | [./app/javascript/packs/direct_uploads.js] 1.84 KiB {direct_uploads} [built]
web_1      | [./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js?!./node_modules/sass-loader/dist/cjs.js?!./app/javascript/packs/application.scss] ./node_modules/css-loader/dist/cjs.js??ref--7-1!./node_modules/postcss-loader/src??ref--7-2!./node_modules/sass-loader/dist/cjs.js??ref--7-3!./app/javascript/packs/application.scss 1.27 KiB {application} [built] [failed] [1 error]
web_1      |     + 1 hidden module
web_1      | 
web_1      | ERROR in ./app/javascript/packs/application.scss (./node_modules/css-loader/dist/cjs.js??ref--7-1!./node_modules/postcss-loader/src??ref--7-2!./node_modules/sass-loader/dist/cjs.js??ref--7-3!./app/javascript/packs/application.scss)
web_1      | Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
web_1      | Error: Missing binding /myapp/node_modules/node-sass/vendor/linux-x64-72/binding.node
web_1      | Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 12.x
web_1      | 
web_1      | Found bindings for the following environments:
web_1      |   - OS X 64-bit with Unsupported runtime (88)
web_1      | 
web_1      | This usually happens because your environment has changed since running `npm install`.
web_1      | Run `npm rebuild node-sass` to download the binding for your current environment.
web_1      |     at module.exports (/myapp/node_modules/node-sass/lib/binding.js:15:13)
web_1      |     at Object.<anonymous> (/myapp/node_modules/node-sass/lib/index.js:14:35)
web_1      |     at Module._compile (/myapp/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
web_1      |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
web_1      |     at Module.load (internal/modules/cjs/loader.js:985:32)
web_1      |     at Function.Module._load (internal/modules/cjs/loader.js:878:14)
web_1      |     at Module.require (internal/modules/cjs/loader.js:1025:19)
web_1      |     at require (/myapp/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
web_1      |     at getDefaultSassImpl (/myapp/node_modules/sass-loader/dist/index.js:198:10)
web_1      |     at Object.loader (/myapp/node_modules/sass-loader/dist/index.js:80:29)
web_1      |  @ ./app/javascript/packs/application.scss 2:26-228

Solution
https://github.com/sass/node-sass/issues/2162#issuecomment-345942114
% docker-compose run --no-deps web bundle exec npm rebuild node-sass 

> node-sass@4.14.1 install /myapp/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.14.1/linux-x64-72_binding.node
Download complete  ] - :
Binary saved to /myapp/node_modules/node-sass/vendor/linux-x64-72/binding.node
Caching binary to /root/.npm/node-sass/4.14.1/linux-x64-72_binding.node

> node-sass@4.14.1 postinstall /myapp/node_modules/node-sass
> node scripts/build.js

Binary found at /myapp/node_modules/node-sass/vendor/linux-x64-72/binding.node
Testing binary
Binary is fine
node-sass@4.14.1 /myapp/node_modules/node-sass
#npm (2) #rebuild (1) #node-sass (1)
List