2

I am needing to install sharp for node.js https://github.com/lovell/sharp but it appears that one of its dependencies (libvips) needs python (and so installation fails as I don't have python on my system and don't expect I'll be able to use python in my production environment).

I read that on the sharp github page it states "OS X, Windows (x64), Linux (x64, ARM) systems do not require the installation of any external runtime dependencies." so I'm not sure why I need python.

2
  • Which operating system are you using for development and production? Commented Aug 17, 2016 at 3:05
  • Windows 10 (x64) for dev and linux for production (heroku or something) Commented Aug 17, 2016 at 3:31

2 Answers 2

3

The sharp package uses node-gyp, which is a tool for "compiling native addon modules for Node.js." Typically native means C or C++ libraries like libvips. Python 2.7 is required for node-gyp to work as explained in the install docs. Despite sharp coming with prebuilt binaries, it still requires node-gyp (for now) as explained in this issue.

Sign up to request clarification or add additional context in comments.

Comments

1

Using version 0.26.x of sharp seems to fix the issue now and doesn't require Python to install. From their changelogs:

Prebuilt libvips binaries are now statically-linked and Brotli-compressed, requiring Node.js 10.16.0+.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.