Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Add support for Node 12 #233

Merged
merged 1 commit into from
May 10, 2019
Merged

Add support for Node 12 #233

merged 1 commit into from
May 10, 2019

Conversation

Gasol
Copy link
Contributor

@Gasol Gasol commented May 9, 2019

Recently I have update Node to 12 through Homebrew on my Mac and notice the build of protagonist is broken, It seems like Node 12 removed the deprecated v8::Handle as following errors.

I get some hints from nodejs/nan#849, Read the docs of nan, and then try to fix it myself.

$ uname -a
Darwin Gasols-MacBook-Pro.local 18.5.0 Darwin Kernel Version 18.5.0: Mon Mar 11 20:40:32 PDT 2019; root:xnu-4903.251.3~3/RELEASE_X86_64 x86_64
$ node -v
v12.1.0

$ npm run build
gyp info it worked if it ends with ok
gyp info using node-gyp@4.0.0
gyp info using node@12.1.0 | darwin | x64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]

  ............... SKIP ..................

  CXX(target) Release/obj.target/protagonist/src/options_parser.o
In file included from ../src/options_parser.cc:2:
../src/protagonist.h:20:43: error: no member named 'Handle' in namespace 'v8'
    OptionsResult* ParseOptionsObject(v8::Handle<v8::Object>, bool);
                                      ~~~~^
../src/protagonist.h:20:60: error: expected '(' for function-style cast or type construction
    OptionsResult* ParseOptionsObject(v8::Handle<v8::Object>, bool);
                                                 ~~~~~~~~~~^
../src/protagonist.h:20:61: error: expected expression
    OptionsResult* ParseOptionsObject(v8::Handle<v8::Object>, bool);
                                                            ^
../src/protagonist.h:20:67: error: expected '(' for function-style cast or type construction
    OptionsResult* ParseOptionsObject(v8::Handle<v8::Object>, bool);
                                                              ~~~~^

  ............... SKIP ..................

10 errors generated.
make: *** [Release/obj.target/protagonist/src/options_parser.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/gasolwu/Code/protagonist/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 Darwin 18.5.0
gyp ERR! command "/usr/local/Cellar/node/12.1.0/bin/node" "/Users/gasolwu/Code/protagonist/node_modules/.bin/node-gyp" "build"
gyp ERR! cwd /Users/gasolwu/Code/protagonist
gyp ERR! node -v v12.1.0
gyp ERR! node-gyp -v v4.0.0
gyp ERR! not ok

@kylef kylef merged commit 0d2a0c3 into apiaryio:master May 10, 2019
@kylef
Copy link
Member

kylef commented May 10, 2019

Thanks for taking the time to add Node 12 support @Gasol!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants