Sharp: Enhancement: add support for Node 12

Created on 23 Apr 2019  Â·  10Comments  Â·  Source: lovell/sharp

gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/ubuntu/.nvm/versions/node/v12.0.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:196:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:256:12)
gyp ERR! System Linux 5.0.0-13-generic
gyp ERR! command "/home/ubuntu/.nvm/versions/node/v12.0.0/bin/node" "/home/ubuntu/.nvm/versions/node/v12.0.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ubuntu/test/node_modules/sharp
gyp ERR! node -v v12.0.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] 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 [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
enhancement

Most helpful comment

v0.22.1 now available with support for Node 12.

All 10 comments

Yes, I see the same thing here. The first compilation failure is:

../src/common.h:80:20: error: ‘Handle’ is not a member of ‘v8’
   bool HasAttr(v8::Handle<v8::Object> obj, std::string attr);
                    ^~~~~~

It looks like the underlying version of V8 in Node 12 finally removed the deprecated v8::Handle, which I think was still required for the version of V8 used in the no-longer-supported Node 4.

Commit aa9b328 removes use of the deprecated API. This will be in v0.22.1.

Thanks for your work, when will v0.22.1 be released?

@DIYgod https://github.com/docker-library/official-images/pull/5789 will allow Node 12 CI and therefore prebuilt binaries, which is worth waiting for.

Looks like Node 12 just got added as tags on the docker image. Strangely, there's no node:12; the most 'generic' is node:12.0 (note the 0 in the minor position)

CI for Linux and OS X now passing with Node 12 - https://travis-ci.org/lovell/sharp/builds/524351959

CI for Windows is dependent on https://github.com/appveyor/ci/issues/2921

@lovell You don't have to wait for an AppVeyor update with Update-NodeJsInstallation
https://github.com/MayhemYDG/iltorb/commit/9a088c34e74cf448a2d6bba4d00dcd5c1880da81
https://ci.appveyor.com/project/MayhemYDG/iltorb/builds/24079316/job/fmh7l7sm6ht5mdjf
This method will make your builds a bit slower, but it's worth it so you don't have to wait for AppVeyor updates.

@lovell Here's a PR for this: https://github.com/lovell/sharp/pull/1669

Waiting for https://github.com/lgeiger/node-abi/pull/62 so we can build for ABI 72 (Node 12).

v0.22.1 now available with support for Node 12.

Updating to sharp 0.22.1 fixed this for me w/ Windows + Node 12, thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Andresmag picture Andresmag  Â·  3Comments

knoxcard picture knoxcard  Â·  3Comments

natural-law picture natural-law  Â·  3Comments

jaekunchoi picture jaekunchoi  Â·  3Comments

jaydenseric picture jaydenseric  Â·  3Comments