Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: add support for Node.js 13 #1909

Closed
lovell opened this issue Oct 9, 2019 · 7 comments
Closed

Enhancement: add support for Node.js 13 #1909

lovell opened this issue Oct 9, 2019 · 7 comments
Milestone

Comments

@lovell
Copy link
Owner

lovell commented Oct 9, 2019

This enhancement exists to preempt the flurry of issues that will otherwise be opened within an hour of Node.js 13 being released, currently scheduled to occur towards the end of this month.

@lovell
Copy link
Owner Author

lovell commented Oct 28, 2019

v0.23.2 now available with prebuilt binaries for Node.js 13.

https://sharp.pixelplumbing.com/en/stable/changelog/#v0232-28th-october-2019

@rightaway
Copy link

I'm getting this error when trying to install 0.23.2 on linux. Anything obvious I'm doing wrong?

Error: /project/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: /project/node_modules/sharp
Output:
info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.7.4/libvips-8.7.4-linux-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=13.1.0 runtime=node arch=x64 libc= platform=linux)
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info find Python using Python version 3.8.0 found at "/usr/bin/python3"
gyp http GET https://nodejs.org/download/release/v13.1.0/node-v13.1.0-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v13.1.0/node-v13.1.0-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v13.1.0/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v13.1.0/SHASUMS256.txt
gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args   '/usr/lib/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   '/project/node_modules/sharp/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/proj/.cache/node-gyp/13.1.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/proj/.cache/node-gyp/13.1.0',
gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/proj/.cache/node-gyp/13.1.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/project/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 args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/project/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/stats.o
../src/stats.cc: In member function ‘virtual void StatsWorker::HandleOKCallback()’:
../src/stats.cc:130:37: error: no matching function for call to ‘v8::Array::Set(int&, v8::Local<v8::Object>&)’
  130 |         channels->Set(i, channelStat);
      |                                     ^
In file included from /home/proj/.cache/node-gyp/13.1.0/include/node/node.h:63,
                 from ../src/stats.cc:19:
/home/proj/.cache/node-gyp/13.1.0/include/node/v8.h:3424:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’
 3424 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
      |                                     ^~~
/home/proj/.cache/node-gyp/13.1.0/include/node/v8.h:3424:37: note:   candidate expects 3 arguments, 2 provided
/home/proj/.cache/node-gyp/13.1.0/include/node/v8.h:3427:37: note: candidate: ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, uint32_t, v8::Local<v8::Value>)’
 3427 |   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
      |                                     ^~~
/home/proj/.cache/node-gyp/13.1.0/include/node/v8.h:3427:37: note:   candidate expects 3 arguments, 2 provided
make: *** [sharp.target.mk:132: Release/obj.target/sharp/src/stats.o] Error 1
make: Leaving directory '/project/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/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 4.19.84-1-lts
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /project/node_modules/sharp
gyp ERR! node -v v13.1.0
gyp ERR! node-gyp -v v6.0.1
gyp ERR! not ok
    at ProcessTermError.ExtendableBuiltin (/usr/lib/node_modules/yarn/lib/cli.js:721:66)
    at ProcessTermError.MessageError (/usr/lib/node_modules/yarn/lib/cli.js:750:123)
    at new ProcessTermError (/usr/lib/node_modules/yarn/lib/cli.js:790:113)
    at ChildProcess.<anonymous> (/usr/lib/node_modules/yarn/lib/cli.js:25884:17)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1028:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

@lovell
Copy link
Owner Author

lovell commented Nov 17, 2019

@rightaway That log looks like sharp v0.22.x and not v0.23.x.

@rightaway
Copy link

I think I don't understand the right process for how to fix the "was compiled against a different Node.js version using NODE_MODULE_VERSION" error message when I install a new version of Node. It's usually some mix of trying to delete node_modules, npm cache, yarn cache, and doing yarn install until things work.

What's the proper set of steps I should follow when I upgrade Node and see that error?

@lovell
Copy link
Owner Author

lovell commented Nov 17, 2019

npm rebuild is usually enough for npm.

yarn tends to cache more aggressively so you're probably correct to clear out all of its caches and nuke node_modules.

@inoyakaigor
Copy link

For information: I've got a same #1696, #1840 error at Node 13.1.0. Downgrading to latest 12.x.x fixed the issue.

@sultanaalyami
Copy link

gyp: binding.gyp not found (cwd: \) 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 (\AppData\Roaming\npm\node_modules\node-gyp\lib\configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:210:5)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "\Program Files\nodejs\node.exe" "\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js" "configure"
gyp ERR! node -v v12.14.0
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok
I cant

@brentvatne brentvatne mentioned this issue Jan 14, 2020
3 tasks
Repository owner locked and limited conversation to collaborators Jan 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants