2.9 KiB
Installation
npm install sharp
Prerequisites
- C++11 compatible compiler such as gcc 4.6+ (Node v4+ requires gcc 4.8+), clang 3.0+ or MSVC 2013
- node-gyp
Linux
libvips and its dependencies are fetched and stored within node_modules/sharp
during npm install
.
This involves an automated HTTPS download of approximately 6MB.
Most recent 64-bit Linux-based operating systems should "just work", e.g.:
- Debian 8
- Ubuntu 12.04, 14.04, 14.10, 15.04, 15.10
- Centos 7
- Fedora 20, 21
- openSUSE 13.2
- Archlinux 2015.06.01
For older and 32-bit Linux-based operating systems,
a system-wide installation of the most suitable version of
libvips and its dependencies can be achieved by running
the following command as a user with sudo
access
(requires curl
and pkg-config
):
curl -s https://raw.githubusercontent.com/lovell/sharp/master/preinstall.sh | sudo bash -
Mac OS
libvips must be installed before npm install
is run.
This can be achieved via homebrew:
brew install homebrew/science/vips --with-webp --with-graphicsmagick
A missing or incorrectly configured Xcode Command Line Tools installation
can lead to a
library not found for -ljpeg
error.
If so, please try: xcode-select --install
.
The gettext dependency of libvips
can lead
to a library not found for -lintl
error.
If so, please try brew link gettext --force
.
Windows
libvips and its dependencies are fetched and stored within node_modules\sharp
during npm install
.
This involves an automated HTTPS download of approximately 11MB.
Only 64-bit (x64) node.exe
is supported.
The WebP format is currently unavailable on Windows.
Heroku
Alessandro Tagliapietra maintains an Heroku buildpack for libvips and its dependencies.
Docker
Marc Bachmann maintains an Ubuntu-based Dockerfile for libvips.
docker pull marcbachmann/libvips
Will Jordan maintains an Alpine-based Dockerfile for libvips.
docker pull wjordan/libvips