On docker-compose up
return process.dlopen(module, path._makeLong(filename));
^
Error: Error loading shared library /usr/src/app/node_modules/sharp/build/Release/sharp.node: Exec format error
at Object.Module._extensions..node (module.js:664:18)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at Object.
at Module._compile (module.js:635:30)
at Module._extensions..js (module.js:646:10)
at Object.require.extensions.(anonymous function) [as .js] (/usr/src/app/node_modules/babel-register/lib/node.js:152:7)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
Hello, the same platform (and same major version of Node) has to be used at both npm install time and runtime.
You've not said what platforms are involved here but I would guess this is an OS X host running a Docker-managed Linux container.
Running npm install inside the container should solve this.