sharp: Cross-platform, includes Meteor: g++: error: ../lib/libvips-cpp.so: No such file or directory
I’m trying to install sharp into a Docker instance running my Meteor app and I’m having a ton of problems installing sharp. It seems that it can not find the correct files for libvips to build.
Here is my dockerfile.
FROM ubuntu:16.04
MAINTAINER Chad Specter
ENV METEORD_DIR /opt/meteord
COPY scripts $METEORD_DIR
RUN bash $METEORD_DIR/init.sh
EXPOSE 80
ENTRYPOINT bash $METEORD_DIR/run_app.sh
//init.sh
set -e
bash $METEORD_DIR/lib/install_base.sh
bash $METEORD_DIR/lib/install_node.sh
bash $METEORD_DIR/lib/install_phantomjs.sh
bash $METEORD_DIR/lib/cleanup.sh
//install_base.sh
set -e
apt-get update -y
apt-get install -y curl bzip2 build-essential libssl-dev python git subversion aptitude libstdc++6 pkg-config libglib2.0-0 libvips-dev libavahi-compat-libdnssd-dev
ldconfig
//install_meteor.sh
set -e
curl -sL https://install.meteor.com | sed s/--progress-bar/-sL/g | /bin/sh
//install_node.sh
set -e
curl -sL https://deb.nodesource.com/setup_4.x | bash -
apt-get update -y
apt-get install -y nodejs
node -v
npm -v
npm -g install npm@latest
npm i -g node-gyp
node-gyp install 4.6.0
node-gyp -v
npm install --global node-pre-gyp
npm install --global nan got semver caw tar
export npm_config_loglevel=http; export npm_config_spin=false
//install_phantomjs.sh
set -e
apt-get -y install libfreetype6 libfreetype6-dev fontconfig
ARCH=`uname -m`
PHANTOMJS_VERSION=1.9.8
PHANTOMJS_TAR_FILE=phantomjs-${PHANTOMJS_VERSION}-linux-${ARCH}.tar.bz2
cd /usr/local/share/
curl -L -O https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-${PHANTOMJS_VERSION}-linux-${ARCH}.tar.bz2
tar xjf $PHANTOMJS_TAR_FILE
ln -s -f /usr/local/share/phantomjs-${PHANTOMJS_VERSION}-linux-${ARCH}/bin/phantomjs /usr/local/share/phantomjs
ln -s -f /usr/local/share/phantomjs-${PHANTOMJS_VERSION}-linux-${ARCH}/bin/phantomjs /usr/local/bin/phantomjs
ln -s -f /usr/local/share/phantomjs-${PHANTOMJS_VERSION}-linux-${ARCH}/bin/phantomjs /usr/bin/phantomjs
rm $PHANTOMJS_TAR_FILE
//cleanup.sh
set -e
# Autoremove any junk
apt-get autoremove -y
# Clean out docs
rm -rf /usr/share/doc /usr/share/doc-base /usr/share/man /usr/share/locale /usr/share/zoneinfo
# Clean out package management dirs
rm -rf /var/lib/cache /var/lib/log
# Clean out /tmp
rm -rf /tmp/*
# Clear npm cache
npm cache clear
Here is the error i’m getting:
> meteor-dev-bundle@0.0.0 install /bundle/bundle/programs/server
> node npm-rebuild.js
> bcrypt@0.8.7 install /bundle/bundle/programs/server/npm/node_modules/bcrypt
> node-gyp rebuild
make: Entering directory '/bundle/bundle/programs/server/npm/node_modules/bcrypt/build'
CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
SOLINK_MODULE(target) Release/obj.target/bcrypt_lib.node
COPY Release/bcrypt_lib.node
make: Leaving directory '/bundle/bundle/programs/server/npm/node_modules/bcrypt/build'
> sharp@0.16.2 install /bundle/bundle/programs/server/npm/node_modules/sharp
> node-gyp rebuild
make: Entering directory '/bundle/bundle/programs/server/npm/node_modules/sharp/build'
TOUCH Release/obj.target/libvips-cpp.stamp
CXX(target) Release/obj.target/sharp/src/common.o
CXX(target) Release/obj.target/sharp/src/metadata.o
CXX(target) Release/obj.target/sharp/src/operations.o
CXX(target) Release/obj.target/sharp/src/pipeline.o
CXX(target) Release/obj.target/sharp/src/sharp.o
CXX(target) Release/obj.target/sharp/src/utilities.o
SOLINK_MODULE(target) Release/obj.target/sharp.node
g++: error: ../lib/libvips-cpp.so: No such file or directory
g++: error: ../lib/libvips.so: No such file or directory
g++: error: ../lib/libglib-2.0.so: No such file or directory
g++: error: ../lib/libgobject-2.0.so: No such file or directory
g++: error: ../lib/libcairo.so: No such file or directory
g++: error: ../lib/libcroco-0.6.so: No such file or directory
g++: error: ../lib/libexif.so: No such file or directory
g++: error: ../lib/libffi.so: No such file or directory
g++: error: ../lib/libfontconfig.so: No such file or directory
g++: error: ../lib/libfreetype.so: No such file or directory
g++: error: ../lib/libgdk_pixbuf-2.0.so: No such file or directory
g++: error: ../lib/libgif.so: No such file or directory
g++: error: ../lib/libgio-2.0.so: No such file or directory
g++: error: ../lib/libgmodule-2.0.so: No such file or directory
g++: error: ../lib/libgsf-1.so: No such file or directory
g++: error: ../lib/libgthread-2.0.so: No such file or directory
g++: error: ../lib/libharfbuzz.so: No such file or directory
g++: error: ../lib/libjpeg.so: No such file or directory
g++: error: ../lib/liblcms2.so: No such file or directory
g++: error: ../lib/liborc-0.4.so: No such file or directory
g++: error: ../lib/libpango-1.0.so: No such file or directory
g++: error: ../lib/libpangocairo-1.0.so: No such file or directory
g++: error: ../lib/libpangoft2-1.0.so: No such file or directory
g++: error: ../lib/libpixman-1.so: No such file or directory
g++: error: ../lib/libpng.so: No such file or directory
g++: error: ../lib/librsvg-2.so: No such file or directory
g++: error: ../lib/libtiff.so: No such file or directory
g++: error: ../lib/libwebp.so: No such file or directory
g++: error: ../lib/libxml2.so: No such file or directory
g++: error: ../lib/libz.so: No such file or directory
sharp.target.mk:179: recipe for target 'Release/obj.target/sharp.node' failed
make: Leaving directory '/bundle/bundle/programs/server/npm/node_modules/sharp/build'
make: *** [Release/obj.target/sharp.node] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:12)
gyp ERR! System Linux 4.4.0-36-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /bundle/bundle/programs/server/npm/node_modules/sharp
gyp ERR! node -v v4.6.2
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm ERR! Linux 4.4.0-36-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "rebuild" "--update-binary"
npm ERR! node v4.6.2
npm ERR! npm v4.0.2
npm ERR! code ELIFECYCLE
npm ERR! sharp@0.16.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp@0.16.2 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the sharp package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs sharp
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls sharp
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /bundle/bundle/programs/server/npm/npm-debug.log
npm WARN meteor-dev-bundle@0.0.0 No description
npm WARN meteor-dev-bundle@0.0.0 No repository field.
npm WARN meteor-dev-bundle@0.0.0 No license field.
npm ERR! Linux 4.4.0-36-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--unsafe-perm"
npm ERR! node v4.6.2
npm ERR! npm v4.0.2
npm ERR! code ELIFECYCLE
npm ERR! meteor-dev-bundle@0.0.0 install: `node npm-rebuild.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the meteor-dev-bundle@0.0.0 install script 'node npm-rebuild.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the meteor-dev-bundle package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node npm-rebuild.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs meteor-dev-bundle
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls meteor-dev-bundle
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /bundle/bundle/programs/server/npm-debug.log
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 16 (7 by maintainers)
Created #861 to improve things.
Using
npm run cleanwithinnode_modules/sharp(to remove the arch-specificvendor/directory and friends) beforenode-gyp rebuildmight work.