jimmynicol / image-resizer

On-the-fly image resizing using Node.js and GraphicsMagick. Heroku Ready!
MIT License
340 stars 105 forks source link

Installation Error #86

Open ezzygemini opened 8 years ago

ezzygemini commented 8 years ago

I've tried installing the package in my local OSX system and it fails when installing sharp. Would you guys know a fix for this?

Admin-iMac:myrepo adminuser$ npm install image-resizer --save
npm WARN engine image-resizer@1.3.0: wanted: {"node":"0.12.x"} (current: {"node":"5.0.0","npm":"3.3.6"})
npm WARN engine image-resizer@1.3.0: wanted: {"node":"0.12.x"} (current: {"node":"5.0.0","npm":"3.3.6"})

> sharp@0.11.4 install /Users/adminuser/repos/myrepo/node_modules/sharp
> node-gyp rebuild

/bin/sh: pkg-config: command not found
gyp: Call to 'PKG_CONFIG_PATH=":$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig" pkg-config --libs vips' returned exit status 127. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:355:16)
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:200:12)
gyp ERR! System Darwin 15.2.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/adminuser/repos/myrepo/node_modules/sharp
gyp ERR! node -v v5.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
myrepo@2.2.41-10 /Users/adminuser/repos/myrepo
└─┬ node-gyp@3.2.1
  └─┬ path-array@1.0.1
    └─┬ array-index@1.0.0
      └── debug@2.2.0 

npm ERR! Darwin 15.2.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "image-resizer" "--save"
npm ERR! node v5.0.0
npm ERR! npm  v3.3.6
npm ERR! code ELIFECYCLE

npm ERR! sharp@0.11.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the sharp@0.11.4 install script 'node-gyp rebuild'.
npm ERR! 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 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!     /Users/adminuser/repos/myrepo/npm-debug.log
ernestopye commented 8 years ago

I've had some issues with the current version of sharp that is being depended on. This is possibly related to #85.

What I've been doing while that gets fixed/released is using npm-shrinkwrap to override the reference to 0.12.0 and it has made the overall experience of installing it much better. I would try that and see if it helps you. I haven't had any issues with using the newer version yet.

ezzygemini commented 8 years ago

Wow, impressive response time. I wasn't expecting a response for a few days.

Thanks, I'll check it out.

vprasanth commented 8 years ago

@ernestopye Hey sorry I've never used npm shrinkwrap before, how exactly do I do this instead of npm install -g image-resizer? Do I instead pull this source, and run npm shrinkwrap ?

teohhanhui commented 8 years ago

@vprasanth Try our fork: npm install -g tripviss/image-resizer

teohhanhui commented 8 years ago

We've updated to sharp v0.16 which comes with prebuilt libvips

https://github.com/tripviss/image-resizer/releases/tag/v1.6.0