question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Libvips binaries error on Docker installation

See original GitHub issue

I’m using docker container and install sharp directly to the container during building image, why i’m came across this error? win32-x64' binaries cannot be used on the 'linuxmusl-x64' platform. Please remove the 'node_modules/sharp/vendor' directory and run 'npm install. host os: Windows 10 64x

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
Luden8commented, Jan 8, 2019

@polarathene my guess is that the problem was with the volume mounting, probably i’ve made mistake while mounting node_modules to the container. dependencies installed correctly inside container, but after mounting was overwritten with the local directory. I’ll check it out later

0reactions
darkmavis1980commented, Jul 17, 2019

I’m actually having the same issue, running my project inside a container with a mounted volume. I can see that the npm install inside the docker container install the correct version:

> sharp@0.22.1 install /app/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.7.4/libvips-8.7.4-linux-x64.tar.gz

And yet when the container starts I get this error

WARNING: NODE_APP_INSTANCE value of '0' did not match any instance config file names.
WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode
Error: 'darwin-x64' binaries cannot be used on the 'linux-x64' platform. Please remove the 'node_modules/sharp/vendor' directory and run 'npm install'.
    at Object.hasVendoredLibvips (/app/node_modules/sharp/lib/libvips.js:61:13)
    at Object.<anonymous> (/app/node_modules/sharp/lib/constructor.js:9:22)
    at Module._compile (internal/modules/cjs/loader.js:799:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)
    at Module.load (internal/modules/cjs/loader.js:666:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:606:12)
    at Function.Module._load (internal/modules/cjs/loader.js:598:3)
    at Module.require (internal/modules/cjs/loader.js:705:19)
    at Module.Hook._require.Module.require (/usr/local/lib/node_modules/pm2/node_modules/require-in-the-middle/index.js:70:37)
    at require (internal/modules/cjs/helpers.js:14:16)
    at Object.<anonymous> (/app/node_modules/sharp/lib/index.js:3:15)
    at Module._compile (internal/modules/cjs/loader.js:799:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)
    at Module.load (internal/modules/cjs/loader.js:666:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:606:12)
    at Function.Module._load (internal/modules/cjs/loader.js:598:3)

I also did put the node_modules folder in the .dockerignore file, but my project it still seems to read from my host machine that the docker container

Read more comments on GitHub >

github_iconTop Results From Across the Web

Express Sharp install via Docker issue - Stack Overflow
I am implementation all steps. Error: 'linux-x64' binaries cannot be used on the 'linuxmusl-x64' platform. Please ...
Read more >
Install Docker Engine from binaries
This page contains information on how to install Docker using binaries. ... This topic discusses binary installation for Linux, Windows, and macOS:.
Read more >
Error when trying to create local project (without docker) fails ...
See below error: Installing Node Packages ... npm WARN deprecated ... ERR! sharp Prebuilt libvips 8.10.0 binaries are not yet available for ...
Read more >
Docker on Apple Silicon M1 - updated in March 2022 - AirTips
#9 72.58 error /app/node_modules/sharp: Command failed. #9 72.58 Exit code: 1 #9 72.58 Command: (node install/libvips && node ...
Read more >
Installing on macOS with homebrew - libvips
The Windows binary is built by build-win64-mxe. This is a containerised mingw build system: on any host, install Docker, clone the project, and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found