Yarn fails to install ‘sharp’ but npm don’t

Here’s a strange thing, I deleted my node_modules folder to test the speed of yarn. The install ran perfectly, but my app crashed with

module.js:471
6:06:17 PM web.1 |      throw err;
6:06:17 PM web.1 |      ^
6:06:17 PM web.1 |  Error: Cannot find module './build/Release/sharp'
6:06:17 PM web.1 |      at Function.Module._resolveFilename (module.js:469:15)

OK, nothing to do with yarn, but strangely, after running npm install everything gets back to normal.

sharp seems to have a pretty complex install process involving external dependencies (see http://sharp.readthedocs.io/en/stable/install/):

libvips and its dependencies are fetched and stored within node_modules/sharp/lib during npm install. This involves an automated HTTPS download of approximately 6.5MB.

It seems to me that yarn doesn’t trigger the post install process. Does it?

Author: Fantashit

1 thought on “Yarn fails to install ‘sharp’ but npm don’t

Comments are closed.