Installing Sharp module provides an error
See original GitHub issueI have…
$ node -v
v11.4.0
$ node-gyp -v
v3.8.0
$ yarn -v
1.12.3
$npm -v
6.4.1
I’m trying to install with yarn and/or npm: $ yarn add sharp
yarn add v1.12.3 info No lockfile found. [1/4] Resolving packages… [2/4] Fetching packages… [3/4] Linking dependencies… [4/4] Building fresh packages… error /projects/test/node_modules/sharp: Command failed. Exit code: 1 Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy) Arguments: Directory: /projects/test/node_modules/sharp Output: info sharp Using cached /home/yesworld/.npm/_libvips/libvips-8.7.0-linux-x64.tar.gz prebuild-install WARN install No prebuilt binaries found (target=11.4.0 runtime=node arch=x64 platform=linux) gyp info it worked if it ends with ok gyp info using node-gyp@3.8.0 gyp info using node@11.4.0 | linux | x64 gyp info spawn /usr/bin/python2 gyp info spawn args [ ‘/home/yesworld/.config/yarn/global/node_modules/node-gyp/gyp/gyp_main.py’, gyp info spawn args ‘binding.gyp’, gyp info spawn args ‘-f’, gyp info spawn args ‘make’, gyp info spawn args ‘-I’, gyp info spawn args ‘/projects/test/node_modules/sharp/build/config.gypi’, gyp info spawn args ‘-I’, gyp info spawn args ‘/home/yesworld/.config/yarn/global/node_modules/node-gyp/addon.gypi’, gyp info spawn args ‘-I’, gyp info spawn args ‘/home/yesworld/.node-gyp/11.4.0/include/node/common.gypi’, gyp info spawn args ‘-Dlibrary=shared_library’, gyp info spawn args ‘-Dvisibility=default’, gyp info spawn args ‘-Dnode_root_dir=/home/yesworld/.node-gyp/11.4.0’, gyp info spawn args ‘-Dnode_gyp_dir=/home/yesworld/.config/yarn/global/node_modules/node-gyp’, gyp info spawn args ‘-Dnode_lib_file=/home/yesworld/.node-gyp/11.4.0/<(target_arch)/node.lib’, gyp info spawn args ‘-Dmodule_root_dir=/projects/test/node_modules/sharp’, gyp info spawn args ‘-Dnode_engine=v8’, gyp info spawn args ‘–depth=.’, gyp info spawn args ‘–no-parallel’, gyp info spawn args ‘–generator-output’, gyp info spawn args ‘build’, gyp info spawn args ‘-Goutput_dir=.’ ] gyp info spawn make gyp info spawn args [ ‘BUILDTYPE=Release’, ‘-C’, ‘build’ ] make: Entering directory ‘/projects/test/node_modules/sharp/build’ TOUCH Release/obj.target/libvips-cpp.stamp CXX(target) Release/obj.target/sharp/src/common.o make: g++: Command not found make: *** [Release/obj.target/sharp/src/common.o] Error 127 sharp.target.mk:128: recipe for target ‘Release/obj.target/sharp/src/common.o’ failed make: Leaving directory ‘/projects/test/node_modules/sharp/build’ gyp ERR! build error gyp ERR! stack Error:
make
failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/home/yesworld/.config/yarn/global/node_modules/node-gyp/lib/build.js:262:23) gyp ERR! stack at ChildProcess.emit (events.js:189:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12) gyp ERR! System Linux 4.15.0-42-generic gyp ERR! command “/usr/bin/node” “/home/yesworld/.yarn/bin/node-gyp” “rebuild” gyp ERR! cwd /projects/test/node_modules/sharp gyp ERR! node -v v11.4.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
OR
$ npm install sharp
.> sharp@0.21.1 install /projects/test/node_modules/sharp .> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
info sharp Using cached /home/yesworld/.npm/_libvips/libvips-8.7.0-linux-x64.tar.gz prebuild-install WARN install No prebuilt binaries found (target=11.4.0 runtime=node arch=x64 platform=linux) make: Entering directory ‘/projects/test/node_modules/sharp/build’ TOUCH Release/obj.target/libvips-cpp.stamp CXX(target) Release/obj.target/sharp/src/common.o make: g++: Command not found sharp.target.mk:128: recipe for target ‘Release/obj.target/sharp/src/common.o’ failed make: *** [Release/obj.target/sharp/src/common.o] Error 127 make: Leaving directory ‘/projects/test/node_modules/sharp/build’ 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:262:23) gyp ERR! stack at ChildProcess.emit (events.js:189:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12) gyp ERR! System Linux 4.15.0-42-generic gyp ERR! command “/usr/bin/node” “/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “rebuild” gyp ERR! cwd /projects/test/node_modules/sharp gyp ERR! node -v v11.4.0 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok npm WARN enoent ENOENT: no such file or directory, open ‘/projects/test/package.json’ npm WARN test No description npm WARN test No repository field. npm WARN test No README data npm WARN test No license field.npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! sharp@0.21.1 install:
(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the sharp@0.21.1 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
What can i do?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Top GitHub Comments
Hello, if you weren’t aware the
nan
dependency added support for Node 11 a couple of days ago in https://github.com/nodejs/nan/pull/830 so the next version of sharp can now support this also.Please do not describe the work of open source maintainers as “terrible” when requesting unpaid help from them in the future.
@lovell Thanks for the solution. We all love open source.