Node-gyp: Bug: Node Gyp build fails on Node v12.1.0 [macOS Mojave]

Created on 1 May 2019  路  2Comments  路  Source: nodejs/node-gyp

  • Node Version: v12.1.0
  • Npm Version: 6.9.0
  • Platform: macOS Mojave 10.14.4
  • Compiler: Apple LLVM version 10.0.1 (clang-1001.0.46.4)
  • Module: node-sass (https://github.com/sass/node-sass)
    Verbose output:
  c++ '-DNODE_GYP_MODULE_NAME=binding' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_DARWIN_USE_64_BIT_INODE=1' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DOPENSSL_THREADS' '-DBUILDING_NODE_EXTENSION' -I/Users/user/.node-gyp/12.1.0/include/node -I/Users/user/.node-gyp/12.1.0/src -I/Users/user/.node-gyp/12.1.0/deps/openssl/config -I/Users/user/.node-gyp/12.1.0/deps/openssl/openssl/include -I/Users/user/.node-gyp/12.1.0/deps/uv/include -I/Users/user/.node-gyp/12.1.0/deps/zlib -I/Users/user/.node-gyp/12.1.0/deps/v8/include -I../../nan -I../src/libsass/include  -Os -gdwarf-2 -mmacosx-version-min=10.7 -arch x86_64 -Wall -Wendif-labels -W -Wno-unused-parameter -std=gnu++1y -stdlib=libc++ -fno-rtti -fno-exceptions -std=c++11 -MMD -MF ./Release/.deps/Release/obj.target/binding/src/create_string.o.d.raw   -c -o Release/obj.target/binding/src/create_string.o ../src/create_string.cpp
../src/create_string.cpp:17:25: error: no matching constructor for initialization of 'v8::String::Utf8Value'
  v8::String::Utf8Value string(value);
                        ^      ~~~~~
/Users/user/.node-gyp/12.1.0/include/node/v8.h:3002:5: note: candidate constructor not viable: no known conversion from 'v8::Local<v8::Value>' to 'const v8::String::Utf8Value' for 1st argument
    Utf8Value(const Utf8Value&) = delete;
    ^
/Users/user/.node-gyp/12.1.0/include/node/v8.h:2995:5: note: candidate constructor not viable: requires 2 arguments, but 1 was provided
    Utf8Value(Isolate* isolate, Local<v8::Value> obj);
    ^
1 error generated.
make: *** [Release/obj.target/binding/src/create_string.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/user/develop/my_project/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/user/develop/my_project/node_modules/node-gyp/bin/node-gyp.js\" \"rebuild\" \"--verbose\" \"--libsass_ext=\" \"--libsass_cflags=\" \"--libsass_ldflags=\" \"--libsass_library=\"
gyp ERR! cwd /Users/user/develop/my_project/node_modules/node-sass
gyp ERR! node -v v12.1.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 

Most helpful comment

I had to install node v11.15.0 and make sure my $PATH for python points to python2, build fine after that. If you're not using nvm and miniconda for that, I highly recommend it.

All 2 comments

I had to install node v11.15.0 and make sure my $PATH for python points to python2, build fine after that. If you're not using nvm and miniconda for that, I highly recommend it.

That's an issue with the module you're trying to build, not node-gyp. IOW, wrong repo.

Was this page helpful?
0 / 5 - 0 ratings