Error building CXX object gnuradio-runtime - linux

I am trying to install a specific version of gnuradio (3.7.10.1). To do so I am not using Pybombs, but I try to do it from source (I am following this).
First I've cloned the github repository, then checkout the appropriate version. It worked fine until I've tried to invoke CMake and build GNU Radio:
mkdir build
cd build
cmake ../
make
During the make, after 6% done, I have the following error:
In file included from /usr/include/c++/7/type_traits:35:0,
from /usr/include/cppunit/tools/StringHelper.h:7,
from /usr/include/cppunit/TestAssert.h:8,
from /usr/include/cppunit/TestCase.h:6,
from /usr/include/cppunit/TestCaller.h:5,
from /usr/include/cppunit/extensions/HelperMacros.h:9,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:26,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:27:
/usr/include/c++/7/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support \
^~~~~
In file included from /usr/include/cppunit/TestAssert.h:8:0,
from /usr/include/cppunit/TestCase.h:6,
from /usr/include/cppunit/TestCaller.h:5,
from /usr/include/cppunit/extensions/HelperMacros.h:9,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:26,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:27:
/usr/include/cppunit/tools/StringHelper.h:22:15: error: ‘enable_if’ in namespace ‘std’ does not name a template type
typename std::enable_if<!std::is_enum<T>::value, std::string>::type toString(const T& x)
^~~~~~~~~
/usr/include/cppunit/tools/StringHelper.h:22:24: error: expected unqualified-id before ‘<’ token
typename std::enable_if<!std::is_enum<T>::value, std::string>::type toString(const T& x)
^
/usr/include/cppunit/tools/StringHelper.h:31:15: error: ‘enable_if’ in namespace ‘std’ does not name a template type
typename std::enable_if<std::is_enum<T>::value, std::string>::type toString(const T& x)
^~~~~~~~~
/usr/include/cppunit/tools/StringHelper.h:31:24: error: expected unqualified-id before ‘<’ token
typename std::enable_if<std::is_enum<T>::value, std::string>::type toString(const T& x)
In file included from /usr/include/cppunit/TestCase.h:6:0,
from /usr/include/cppunit/TestCaller.h:5,
from /usr/include/cppunit/extensions/HelperMacros.h:9,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:26,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:27:
/usr/include/cppunit/TestAssert.h: In static member function ‘static std::__cxx11::string CppUnit::assertion_traits<T>::toString(const T&)’:
/usr/include/cppunit/TestAssert.h:74:42: error: ‘toString’ is not a member of ‘CppUnit::StringHelper’
return CPPUNIT_NS::StringHelper::toString(x);
^~~~~~~~
In file included from /usr/include/cppunit/extensions/HelperMacros.h:9:0,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:26,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:27:
/usr/include/cppunit/TestCaller.h: At global scope:
/usr/include/cppunit/TestCaller.h:159:37: error: ‘std::function’ has not been declared
TestCaller(std::string name, std::function<void()> test_function, Fixture* fixture):
^~~~~~~~
/usr/include/cppunit/TestCaller.h:159:45: error: expected ‘,’ or ‘...’ before ‘<’ token
TestCaller(std::string name, std::function<void()> test_function, Fixture* fixture):
^
/usr/include/cppunit/TestCaller.h:200:8: error: ‘function’ in namespace ‘std’ does not name a template type
std::function<void()> m_test_function;
^~~~~~~~
/usr/include/cppunit/TestCaller.h: In constructor ‘CppUnit::TestCaller<Fixture>::TestCaller(std::__cxx11::string, CppUnit::TestCaller<Fixture>::TestMethod)’:
/usr/include/cppunit/TestCaller.h:121:6: error: class ‘CppUnit::TestCaller<Fixture>’ does not have any field named ‘m_test_function’
m_test_function( std::bind(test, m_fixture) )
^~~~~~~~~~~~~~~
/usr/include/cppunit/TestCaller.h:121:28: error: ‘bind’ is not a member of ‘std’
m_test_function( std::bind(test, m_fixture) )
^~~~
/usr/include/cppunit/TestCaller.h:121:28: note: suggested alternative: ‘find’
m_test_function( std::bind(test, m_fixture) )
^~~~
find
/usr/include/cppunit/TestCaller.h: In constructor ‘CppUnit::TestCaller<Fixture>::TestCaller(std::__cxx11::string, CppUnit::TestCaller<Fixture>::TestMethod, Fixture&)’:
/usr/include/cppunit/TestCaller.h:138:6: error: class ‘CppUnit::TestCaller<Fixture>’ does not have any field named ‘m_test_function’
m_test_function( std::bind(test, &fixture) )
^~~~~~~~~~~~~~~
/usr/include/cppunit/TestCaller.h:138:28: error: ‘bind’ is not a member of ‘std’
m_test_function( std::bind(test, &fixture) )
^~~~
/usr/include/cppunit/TestCaller.h:138:28: note: suggested alternative: ‘find’
m_test_function( std::bind(test, &fixture) )
^~~~
find
/usr/include/cppunit/TestCaller.h: In constructor ‘CppUnit::TestCaller<Fixture>::TestCaller(std::__cxx11::string, CppUnit::TestCaller<Fixture>::TestMethod, Fixture*)’:
/usr/include/cppunit/TestCaller.h:155:6: error: class ‘CppUnit::TestCaller<Fixture>’ does not have any field named ‘m_test_function’
m_test_function( std::bind(test, fixture) )
^~~~~~~~~~~~~~~
/usr/include/cppunit/TestCaller.h:155:28: error: ‘bind’ is not a member of ‘std’
m_test_function( std::bind(test, fixture) )
^~~~
/usr/include/cppunit/TestCaller.h:155:28: note: suggested alternative: ‘find’
m_test_function( std::bind(test, fixture) )
^~~~
find
/usr/include/cppunit/TestCaller.h: In constructor ‘CppUnit::TestCaller<Fixture>::TestCaller(std::__cxx11::string, int)’:
/usr/include/cppunit/TestCaller.h:162:17: error: ‘fixture’ was not declared in this scope
m_fixture(fixture),
^~~~~~~
/usr/include/cppunit/TestCaller.h:162:17: note: suggested alternative: ‘Fixture’
m_fixture(fixture),
^~~~~~~
Fixture
/usr/include/cppunit/TestCaller.h:163:7: error: class ‘CppUnit::TestCaller<Fixture>’ does not have any field named ‘m_test_function’
m_test_function(test_function)
^~~~~~~~~~~~~~~
/usr/include/cppunit/TestCaller.h:163:23: error: ‘test_function’ was not declared in this scope
m_test_function(test_function)
^~~~~~~~~~~~~
/usr/include/cppunit/TestCaller.h: In member function ‘void CppUnit::TestCaller<Fixture>::runTest()’:
/usr/include/cppunit/TestCaller.h:175:7: error: there are no arguments to ‘m_test_function’ that depend on a template parameter, so a declaration of ‘m_test_function’ must be available [-fpermissive]
m_test_function();
^~~~~~~~~~~~~~~
/usr/include/cppunit/TestCaller.h:175:7: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
In file included from /usr/include/cppunit/extensions/HelperMacros.h:14:0,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:26,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:27:
/usr/include/cppunit/extensions/TestNamer.h: In member function ‘std::__cxx11::string CppUnit::TestNamer::getTestNameFor(const string&, const E&) const’:
/usr/include/cppunit/extensions/TestNamer.h:70:95: error: ‘toString’ is not a member of ‘CppUnit::StringHelper’
return getTestNameFor(testMethodName) + " with parameter: " + CPPUNIT_NS::StringHelper::toString(val);
^~~~~~~~
In file included from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:26:0,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:27:
/home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h: In static member function ‘static CppUnit::TestSuite* qa_fxpt::suite()’:
/home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:36:3: error: ‘unique_ptr’ is not a member of ‘std’
CPPUNIT_TEST_SUITE_END();
^
/home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:36:3: error: expected primary-expression before ‘>’ token
CPPUNIT_TEST_SUITE_END();
^
/home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:36:3: error: ‘guard’ was not declared in this scope
CPPUNIT_TEST_SUITE_END();
^
In file included from /usr/include/cppunit/extensions/HelperMacros.h:9:0,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.h:26,
from /home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:27:
/usr/include/cppunit/TestCaller.h: In instantiation of ‘void CppUnit::TestCaller<Fixture>::runTest() [with Fixture = qa_fxpt]’:
/home/cofex/workarea/gnuradio/gnuradio-runtime/lib/math/qa_fxpt.cc:102:1: required from here
/usr/include/cppunit/TestCaller.h:175:22: error: ‘m_test_function’ was not declared in this scope
m_test_function();
~~~~~~~~~~~~~~~^~
/usr/include/cppunit/TestCaller.h:175:22: note: suggested alternative: ‘__fortify_function’
m_test_function();
~~~~~~~~~~~~~~~^~
__fortify_function
gnuradio-runtime/lib/CMakeFiles/test-gnuradio-runtime.dir/build.make:62: recipe for target 'gnuradio-runtime/lib/CMakeFiles/test-gnuradio-runtime.dir/math/qa_fxpt.cc.o' failed
make[2]: *** [gnuradio-runtime/lib/CMakeFiles/test-gnuradio-runtime.dir/math/qa_fxpt.cc.o] Error 1
CMakeFiles/Makefile2:726: recipe for target 'gnuradio-runtime/lib/CMakeFiles/test-gnuradio-runtime.dir/all' failed
make[1]: *** [gnuradio-runtime/lib/CMakeFiles/test-gnuradio-runtime.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2
I am not a Linux expert and I am not very familiar to this compiler/library support. I don't really understand where the error comes from and how to correct it.
I use Ubuntu 18.04.
Coud you give me a hand on this please?
Any help would be very appreciated.
Thanks a lot.

/usr/include/c++/7/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
To resolve the above error you need to compile with -std=c++11 flag. Open CMakeLists.txt, find all occurrences or -std=c++98 and change them to -std=c++11. Then go to the build directory, remove CMakeCache.txt and rebuild
sed -i 's/-std=c++98/-std=c++11/g' CMakeLists.txt
cd build
rm CMakeCache.txt
cmake ..
make
Also as the error is in the cppunit and it's used for testing you can try disabling all tests
cd build
rm CMakeCache.txt
cmake -DENABLE_TESTING=OFF ..
make

Related

Building rust with LLVM Fork

Following the instructions here, I have tried building rust with a fork of LLVM which has a back-end for a new target.
I have:
Recursively cloned the Rust repository
Edited config.toml to add the new target,
Replaced with custom LLVM Fork by:
cd src/llvm-project
git remote add custom-fork [link to custom fork]
git checkout custom-fork/branch
then committing these changes.
Build rust with x.py build.
The LLVM fork has been rebased onto LLVM 13.0
cargo:warning=llvm-wrapper/PassWrapper.cpp: In function ‘void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef)’:
cargo:warning=llvm-wrapper/PassWrapper.cpp:502:57: error: ‘const class llvm::MCSubtargetInfo’ has no member named ‘getCPUTable’
cargo:warning= 502 | const ArrayRef<SubtargetSubTypeKV> CPUTable = MCInfo->getCPUTable();
cargo:warning= | ^~~~~~~~~~~
cargo:warning=llvm-wrapper/PassWrapper.cpp: In function ‘size_t LLVMRustGetTargetFeaturesCount(LLVMTargetMachineRef)’:
cargo:warning=llvm-wrapper/PassWrapper.cpp:519:58: error: ‘const class llvm::MCSubtargetInfo’ has no member named ‘getFeatureTable’; did you mean ‘getFeatureBits’?
cargo:warning= 519 | const ArrayRef<SubtargetFeatureKV> FeatTable = MCInfo->getFeatureTable();
cargo:warning= | ^~~~~~~~~~~~~~~
cargo:warning= | getFeatureBits
cargo:warning=llvm-wrapper/PassWrapper.cpp: In function ‘void LLVMRustGetTargetFeature(LLVMTargetMachineRef, size_t, const char**, const char**)’:
cargo:warning=llvm-wrapper/PassWrapper.cpp:527:58: error: ‘const class llvm::MCSubtargetInfo’ has no member named ‘getFeatureTable’; did you mean ‘getFeatureBits’?
cargo:warning= 527 | const ArrayRef<SubtargetFeatureKV> FeatTable = MCInfo->getFeatureTable();
cargo:warning= | ^~~~~~~~~~~~~~~
cargo:warning= | getFeatureBits
exit status: 1
--- stderr
This same error occurs when using the upstream LLVM; I'm unsure whether this is due to a patch that has been applied to the rust LLVM fork that needs to be ported over, or if I just need to change something in the llvm-wrapper.

bcrypt warnings inside of Docker

Is there some solution to get rid of this warning? Console displays it during the Docker image creating. There are a lot of topics all over the internet and no working solution. Since bcrypt js lib creators think that it's fine to not fixing it for years maybe it's possible to import something manually or anything like that.
Node.js v12
bcrypt v3
Docker v19
> bcrypt#3.0.6 install /usr/src/app/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using request for node-pre-gyp https download
make: Entering directory '/usr/src/app/node_modules/bcrypt/build'
CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
In file included from ../src/bcrypt_node.cc:1:
../../nan/nan.h: In function 'void Nan::AsyncQueueWorker(Nan::AsyncWorker*)':
../../nan/nan.h:2232:62: warning: cast between incompatible function types from 'void (*)(uv_work_t*)' {aka 'void (*)(uv_work_s*)'} to 'uv_after_work_cb' {aka 'void (*)(uv_work_s*, int)'} [-Wcast-function-type]
, reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
^
In file included from ../../nan/nan.h:53,
from ../src/bcrypt_node.cc:1:
../src/bcrypt_node.cc: At global scope:
/root/.node-gyp/12.4.0/include/node/node.h:556:43: warning: cast between incompatible function types from 'void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)' {aka 'void (*)(v8::Local<v8::Object>)'} to 'node::addon_register_func' {aka 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)'} [-Wcast-function-type]
(node::addon_register_func) (regfunc), \
^
/root/.node-gyp/12.4.0/include/node/node.h:590:3: note: in expansion of macro 'NODE_MODULE_X'
NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage)
^~~~~~~~~~~~~
../src/bcrypt_node.cc:378:1: note: in expansion of macro 'NODE_MODULE'
NODE_MODULE(bcrypt_lib, init);
^~~~~~~~~~~
In file included from /root/.node-gyp/12.4.0/include/node/node.h:63,
from ../../nan/nan.h:53,
from ../src/bcrypt_node.cc:1:
/root/.node-gyp/12.4.0/include/node/v8.h: In instantiation of 'void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]':
/root/.node-gyp/12.4.0/include/node/node_object_wrap.h:84:78: required from here
/root/.node-gyp/12.4.0/include/node/v8.h:9817:16: warning: cast between incompatible function types from 'v8::WeakCallbackInfo<node::ObjectWrap>::Callback' {aka 'void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)'} to 'Callback' {aka 'void (*)(const v8::WeakCallbackInfo<void>&)'} [-Wcast-function-type]
reinterpret_cast<Callback>(callback), type);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/root/.node-gyp/12.4.0/include/node/v8.h: In instantiation of 'void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]':
../../nan/nan_object_wrap.h:65:61: required from here
/root/.node-gyp/12.4.0/include/node/v8.h:9817:16: warning: cast between incompatible function types from 'v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback' {aka 'void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)'} to 'Callback' {aka 'void (*)(const v8::WeakCallbackInfo<void>&)'} [-Wcast-function-type]```
the warning is there for a reason, if you want to hide it, you have few choices
submit a fix to upstream to actually fix the code to remove the warning
hide it by submitting a fix to upstream and add -Wno-cast-function-type to gcc. it's up to maintainer to accept it.
submit a fix to upstream to add prebuilt binary for node 12 so that you won't have to compile every time (hence it won't trigger gcc to build). right now looks like only windows have prebuilt binary for node 12 (search for v72-linux)
https://github.com/kelektiv/node.bcrypt.js/releases/tag/v3.0.6
Are you able to use bycryptjs to avoid this issue?
The bycrypt entirely depends on the node version. Or you have to choose the suitable version of bycrypt or downgrade the version of bycrypt

Unable to install raw-socket#1.2.6 using the npm 3.10.10

I tried to install raw-socket [1.2.6] module in nodejs using the npm. When I am trying to install the module, got the following error..
Node version : 6.11.3
NPM version : 3.10.10
[test#test node_modules]$ npm install raw-socket2
> raw-socket2#1.2.6 install /home/test/node_modules/raw-socket2
> node-gyp rebuild
make: Entering directory `/home/test/node_modules/raw-socket2/build'
CXX(target) Release/obj.target/raw/src/raw.o
In file included from /home/test/.node-gyp/6.11.3/include/node/node.h:42,
from ../../nan/nan.h:24,
from ../src/raw.cc:4:
/home/test/.node-gyp/6.11.3/include/node/v8.h:345: error: expected unqualified-id before ‘using’
/home/test/.node-gyp/6.11.3/include/node/v8.h: In constructor ‘v8::MaybeLocal<T>::MaybeLocal()’:
/home/test/.node-gyp/6.11.3/include/node/v8.h:362: error: ‘nullptr’ was not declared in this scope
/home/test/.node-gyp/6.11.3/include/node/v8.h: In member function ‘bool v8::MaybeLocal<T>::IsEmpty() const’:
/home/test/.node-gyp/6.11.3/include/node/v8.h:369: error: ‘nullptr’ was not declared in this scope
/home/test/.node-gyp/6.11.3/include/node/v8.h: In member function ‘bool v8::MaybeLocal<T>::ToLocal(v8::Local<S>*) const’:
/home/test/.node-gyp/6.11.3/include/node/v8.h:373: error: ‘nullptr’ was not declared in this scope
/home/test/.node-gyp/6.11.3/include/node/v8.h: In member function ‘bool v8::WeakCallbackInfo<T>::IsFirstPass() const’:
/home/test/.node-gyp/6.11.3/include/node/v8.h:441: error: ‘nullptr’ was not declared in this scope
/home/test/.node-gyp/6.11.3/include/node/v8.h: At global scope:
/home/test/.node-gyp/6.11.3/include/node/v8.h:481: error: expected unqualified-id before ‘using’
/home/test/.node-gyp/6.11.3/include/node/v8.h: In constructor ‘v8::Global<T>::Global()’:
/home/test/.node-gyp/6.11.3/include/node/v8.h:820: error: ‘nullptr’ was not declared in this scope
/home/test/.node-gyp/6.11.3/include/node/v8.h: In constructor ‘v8::Global<T>::Global(v8::Global<T>&&)’:
/home/test/.node-gyp/6.11.3/include/node/v8.h:845: error: ‘nullptr’ was not declared in this scope
/home/test/.node-gyp/6.11.3/include/node/v8.h: In member function ‘v8::Global<T>& v8::Global<T>::operator=(v8::Global<S>&&)’:
/home/test/.node-gyp/6.11.3/include/node/v8.h:857: error: ‘nullptr’ was not declared in this scope
/home/test/.node-gyp/6.11.3/include/node/v8.h: At global scope:
/home/test/.node-gyp/6.11.3/include/node/v8.h:882: error: expected unqualified-id before ‘using’
/home/test/.node-gyp/6.11.3/include/node/v8.h:1119: error: ‘nullptr’ was not declared in this scope
/home/test/.node-gyp/6.11.3/include/node/v8.h:1125: error: ‘nullptr’ was not declared in this scope
/home/test/.node-gyp/6.11.3/include/node/v8.h: In member function ‘v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>) const’:
/home/test/.node-gyp/6.11.3/include/node/v8.h:3279: error: ‘nullptr’ was not declared in this scope
/home/test/.node-gyp/6.11.3/include/node/v8.h: At global scope:
/home/test/.node-gyp/6.11.3/include/node/v8.h:4499: error: ‘nullptr’ was not declared in this scope
/home/test/.node-gyp/6.11.3/include/node/v8.h:4515: error: ‘nullptr’ was not declared in this scope
/home/test/.node-gyp/6.11.3/include/node/v8.h: In member function ‘v8::Local<T> v8::MaybeLocal<T>::ToLocalChecked()’:
/home/test/.node-gyp/6.11.3/include/node/v8.h:7544: error: ‘nullptr’ was not declared in this scope
In file included from ../../nan/nan.h:111,
from ../src/raw.cc:4:
../../nan/nan_new.h: At global scope:
../../nan/nan_new.h:24: error: template declaration of ‘v8::Local<T> Nan::imp::To’
../../nan/nan_new.h:24: error: ‘Handle’ is not a member of ‘v8’
../../nan/nan_new.h:24: error: expected primary-expression before ‘>’ token
../../nan/nan_new.h:24: error: ‘i’ was not declared in this scope
../../nan/nan_new.h:29: error: expected initializer before ‘<’ token
../../nan/nan_new.h:34: error: expected initializer before ‘<’ token
../../nan/nan_new.h:39: error: expected initializer before ‘<’ token
../../nan/nan_new.h:66: error: ‘v8::Handle’ has not been declared
../../nan/nan_new.h:66: error: expected ‘,’ or ‘...’ before ‘<’ token
../../nan/nan_new.h:65: error: default argument missing for parameter 2 of ‘static v8::Local<v8::Context> Nan::imp::Factory<v8::Context>::New(v8::ExtensionConfiguration*, int)’
../../nan/nan_new.h:85: error: ‘v8::Handle’ has not been declared
../../nan/nan_new.h:85: error: expected ‘,’ or ‘...’ before ‘<’ token
../../nan/nan_new.h:93: error: ‘v8::Handle’ has not been declared
../../nan/nan_new.h:93: error: expected ‘,’ or ‘...’ before ‘<’ token
../../nan/nan_new.h:92: error: default argument missing for parameter 2 of ‘static v8::Local<v8::FunctionTemplate> Nan::imp::Factory<v8::FunctionTemplate>::New(void (*)(const v8::FunctionCallbackInfo<v8::Value>&), int)’
../../nan/nan_new.h:139: error: ‘v8::Handle’ has not been declared
../../nan/nan_new.h:139: error: expected ‘,’ or ‘...’ before ‘<’ token
../../nan/nan_new.h:151: error: ISO C++ forbids declaration of ‘Handle’ with no type
../../nan/nan_new.h:151: error: typedef name may not be a nested-name-specifier
../../nan/nan_new.h:151: error: expected ‘;’ before ‘<’ token
../../nan/nan_new.h:152: error: ‘FTH’ has not been declared
../../nan/nan_new.h:152: error: ‘FTH’ was not declared in this scope
../../nan/nan_new.h:171: error: ‘v8::Handle’ has not been declared
../../nan/nan_new.h:171: error: expected ‘,’ or ‘...’ before ‘<’ token
In file included from ../../nan/nan_new.h:191,
from ../../nan/nan.h:111,
from ../src/raw.cc:4:
../../nan/nan_implementation_12_inl.h: In static member function ‘static v8::Local<v8::BooleanObject> Nan::imp::Factory<v8::BooleanObject>::New(bool)’:
../../nan/nan_implementation_12_inl.h:49: warning: ‘static v8::Local<v8::Value> v8::BooleanObject::New(bool)’ is deprecated (declared at /home/test/.node-gyp/6.11.3/include/node/v8.h:4009)
../../nan/nan_implementation_12_inl.h: At global scope:
../../nan/nan_implementation_12_inl.h:56: error: ‘v8::Handle’ has not been declared
../../nan/nan_implementation_12_inl.h:56: error: expected ‘,’ or ‘...’ before ‘<’ token
../../nan/nan_implementation_12_inl.h: In static member function ‘static v8::Local<v8::Context> Nan::imp::Factory<v8::Context>::New(v8::ExtensionConfiguration*, int)’:
../../nan/nan_implementation_12_inl.h:58: error: ‘tmpl’ was not declared in this scope
../../nan/nan_implementation_12_inl.h:58: error: ‘obj’ was not declared in this scope
../../nan/nan_implementation_12_inl.h: At global scope:
../../nan/nan_implementation_12_inl.h:79: error: ‘v8::Handle’ has not been declared
../../nan/nan_implementation_12_inl.h:79: error: expected ‘,’ or ‘...’ before ‘<’ token
../../nan/nan_implementation_12_inl.h: In static member function ‘static v8::Local<v8::Function> Nan::imp::Factory<v8::Function>::New(void (*)(const v8::FunctionCallbackInfo<v8::Value>&), int)’:
../../nan/nan_implementation_12_inl.h:82: error: ‘data’ was not declared in this scope
../../nan/nan_implementation_12_inl.h: At global scope:
../../nan/nan_implementation_12_inl.h:89: error: ‘v8::Handle’ has not been declared
../../nan/nan_implementation_12_inl.h:89: error: expected ‘,’ or ‘...’ before ‘<’ token
../../nan/nan_implementation_12_inl.h: In static member function ‘static v8::Local<v8::FunctionTemplate> Nan::imp::Factory<v8::FunctionTemplate>::New(void (*)(const v8::FunctionCallbackInfo<v8::Value>&), int)’:
../../nan/nan_implementation_12_inl.h:93: error: ‘data’ was not declared in this scope
../../nan/nan_implementation_12_inl.h:94: error: ‘signature’ was not declared in this scope
../../nan/nan_implementation_12_inl.h: In static member function ‘static typename Nan::imp::IntegerFactory<T>::return_t Nan::imp::IntegerFactory<T>::New(int32_t)’:
../../nan/nan_implementation_12_inl.h:117: error: ‘To’ was not declared in this scope
../../nan/nan_implementation_12_inl.h:117: error: expected primary-expression before ‘>’ token
../../nan/nan_implementation_12_inl.h: In static member function ‘static typename Nan::imp::IntegerFactory<T>::return_t Nan::imp::IntegerFactory<T>::New(uint32_t)’:
../../nan/nan_implementation_12_inl.h:123: error: ‘To’ was not declared in this scope
../../nan/nan_implementation_12_inl.h:123: error: expected primary-expression before ‘>’ token
../../nan/nan_implementation_12_inl.h: In static member function ‘static v8::Local<v8::Uint32> Nan::imp::Factory<v8::Uint32>::New(int32_t)’:
../../nan/nan_implementation_12_inl.h:128: error: ‘To’ was not declared in this scope
../../nan/nan_implementation_12_inl.h:128: error: expected primary-expression before ‘>’ token
../../nan/nan_implementation_12_inl.h: In static member function ‘static v8::Local<v8::Uint32> Nan::imp::Factory<v8::Uint32>::New(uint32_t)’:
../../nan/nan_implementation_12_inl.h:134: error: ‘To’ was not declared in this scope
../../nan/nan_implementation_12_inl.h:134: error: expected primary-expression before ‘>’ token
../../nan/nan_implementation_12_inl.h: At global scope:
../../nan/nan_implementation_12_inl.h:156: error: ‘v8::Local<v8::RegExp> Nan::imp::Factory<v8::RegExp>::New’ is not a static member of ‘struct Nan::imp::Factory<v8::RegExp>’
../../nan/nan_implementation_12_inl.h:156: error: ‘Handle’ is not a member of ‘v8’
../../nan/nan_implementation_12_inl.h:156: error: expected primary-expression before ‘>’ token
../../nan/nan_implementation_12_inl.h:156: error: ‘pattern’ was not declared in this scope
../../nan/nan_implementation_12_inl.h:157: error: expected primary-expression before ‘flags’
../../nan/nan_implementation_12_inl.h:157: error: expected ‘,’ or ‘;’ before ‘{’ token
../../nan/nan_implementation_12_inl.h: In static member function ‘static v8::Local<v8::Script> Nan::imp::Factory<v8::Script>::New(v8::Local<v8::String>)’:
../../nan/nan_implementation_12_inl.h:166: warning: ‘static v8::Local<v8::Script> v8::ScriptCompiler::Compile(v8::Isolate*, v8::ScriptCompiler::Source*, v8::ScriptCompiler::CompileOptions)’ is deprecated (declared at /home/test/.node-gyp/6.11.3/include/node/v8.h:1352)
../../nan/nan_implementation_12_inl.h: In static member function ‘static v8::Local<v8::Script> Nan::imp::Factory<v8::Script>::New(v8::Local<v8::String>, const v8::ScriptOrigin&)’:
../../nan/nan_implementation_12_inl.h:173: warning: ‘static v8::Local<v8::Script> v8::ScriptCompiler::Compile(v8::Isolate*, v8::ScriptCompiler::Source*, v8::ScriptCompiler::CompileOptions)’ is deprecated (declared at /home/test/.node-gyp/6.11.3/include/node/v8.h:1352)
../../nan/nan_implementation_12_inl.h: At global scope:
../../nan/nan_implementation_12_inl.h:179: error: ‘v8::Local<v8::Signature> Nan::imp::Factory<v8::Signature>::New’ is not a static member of ‘struct Nan::imp::Factory<v8::Signature>’
../../nan/nan_implementation_12_inl.h:179: error: ‘FTH’ is not a member of ‘Nan::imp::Factory<v8::Signature>’
../../nan/nan_implementation_12_inl.h:179: error: expected ‘,’ or ‘;’ before ‘{’ token
../../nan/nan_implementation_12_inl.h: In static member function ‘static v8::Local<v8::String> Nan::imp::Factory<v8::String>::New(const uint8_t*, int)’:
../../nan/nan_implementation_12_inl.h:206: warning: ‘static v8::Local<v8::String> v8::String::NewFromOneByte(v8::Isolate*, const uint8_t*, v8::String::NewStringType, int)’ is deprecated (declared at /home/test/.node-gyp/6.11.3/include/node/v8.h:2332)
../../nan/nan_implementation_12_inl.h: In static member function ‘static v8::Local<v8::String> Nan::imp::Factory<v8::String>::New(v8::String::ExternalStringResource*)’:
../../nan/nan_implementation_12_inl.h:217: warning: ‘static v8::Local<v8::String> v8::String::NewExternal(v8::Isolate*, v8::String::ExternalStringResource*)’ is deprecated (declared at /home/test/.node-gyp/6.11.3/include/node/v8.h:2371)
../../nan/nan_implementation_12_inl.h: At global scope:
../../nan/nan_implementation_12_inl.h:228: error: ‘v8::Local<v8::StringObject> Nan::imp::Factory<v8::StringObject>::New’ is not a static member of ‘struct Nan::imp::Factory<v8::StringObject>’
../../nan/nan_implementation_12_inl.h:228: error: ‘Handle’ is not a member of ‘v8’
../../nan/nan_implementation_12_inl.h:228: error: expected primary-expression before ‘>’ token
../../nan/nan_implementation_12_inl.h:228: error: ‘value’ was not declared in this scope
../../nan/nan_implementation_12_inl.h:228: error: expected ‘,’ or ‘;’ before ‘{’ token
../../nan/nan_implementation_12_inl.h: In static member function ‘static v8::Local<v8::UnboundScript> Nan::imp::Factory<v8::UnboundScript>::New(v8::Local<v8::String>)’:
../../nan/nan_implementation_12_inl.h:237: warning: ‘static v8::Local<v8::UnboundScript> v8::ScriptCompiler::CompileUnbound(v8::Isolate*, v8::ScriptCompiler::Source*, v8::ScriptCompiler::CompileOptions)’ is deprecated (declared at /home/test/.node-gyp/6.11.3/include/node/v8.h:1333)
../../nan/nan_implementation_12_inl.h: In static member function ‘static v8::Local<v8::UnboundScript> Nan::imp::Factory<v8::UnboundScript>::New(v8::Local<v8::String>, const v8::ScriptOrigin&)’:
../../nan/nan_implementation_12_inl.h:244: warning: ‘static v8::Local<v8::UnboundScript> v8::ScriptCompiler::CompileUnbound(v8::Isolate*, v8::ScriptCompiler::Source*, v8::ScriptCompiler::CompileOptions)’ is deprecated (declared at /home/test/.node-gyp/6.11.3/include/node/v8.h:1333)
../../nan/nan_implementation_12_inl.h: At global scope:
../../nan/nan_implementation_12_inl.h:253: error: ‘NanNew’ declared as an ‘inline’ variable
../../nan/nan_implementation_12_inl.h:253: error: template declaration of ‘v8::Local<T> NanNew’
../../nan/nan_implementation_12_inl.h:253: error: ‘Handle’ is not a member of ‘v8’
../../nan/nan_implementation_12_inl.h:253: error: expected primary-expression before ‘>’ token
../../nan/nan_implementation_12_inl.h:253: error: ‘h’ was not declared in this scope
.
.
.
../../nan/nan.h:2112: error: expected ‘,’ or ‘;’ before ‘{’ token
../../nan/nan.h:2109: warning: ‘_NanGetExternalParts’ defined but not used
make: *** [Release/obj.target/raw/src/raw.o] Error 1
make: Leaving directory `/home/test/node_modules/raw-socket2/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/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit
(internal/child_process.js:219:12)
gyp ERR! System Linux 2.6.32-642.el6.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/test/node_module`enter code here`s/raw-socket2
gyp ERR! node -v v6.11.3
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm WARN watchdog#1.0.0 No repository field.
npm WARN watchdog#1.0.0 license should be a valid SPDX license expression
npm ERR! Linux 2.6.32-642.el6.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "raw-socket2"
npm ERR! node v6.11.3
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! raw-socket2#1.2.6 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the raw-socket2#1.2.6 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the raw-socket2 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 information on how to open an issue for this project with:
npm ERR! npm bugs raw-socket2
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls raw-socket2
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/test/node_modules/npm-debug.log
We tried the same in different version of nodejs. But, work fine in the version0.10.36.
You're not installing raw-socket, you're installing raw-socket2, which is a fork of the former, but one that hasn't been maintained very well (and therefore doesn't install on more recent versions of Node.js).
The original raw-socket seems to work okay in Node 8 (although the compiler does emit various warnings during installation, but warnings aren't errors).

node-gyp rebuild error while installing an npm package

I'm trying to install "karma" and "grunt-karma" for a project and I end up with the following npm error. I'm running MacOS Sierra v10.12.4, XCode v8.3.2 with command line tools installed, node v7.9.0, node-gyp v3.5.0.
Before pasting this here I read all the SO topics about this and also some other ones on GitHub, but nothing worked.
> bufferutil#1.1.0 install /Users/cc/project/node_modules/bufferutil
> node-gyp rebuild
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
In file included from ../src/bufferutil.cc:16:
In file included from ../node_modules/nan/nan.h:82:
../node_modules/nan/nan_new.h:34:56: warning: 'ToInt32' is deprecated
[-Wdeprecated-declarations]
To<v8::Int32>(v8::Handle<v8::Integer> i) { return i->ToInt32(); }
^
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:9041:21: note: 'ToInt32'
has been explicitly marked deprecated here
Local<Int32> Value::ToInt32() const {
^
In file included from ../src/bufferutil.cc:16:
In file included from ../node_modules/nan/nan.h:82:
../node_modules/nan/nan_new.h:39:56: warning: 'ToUint32' is deprecated
[-Wdeprecated-declarations]
To<v8::Uint32>(v8::Handle<v8::Integer> i) { return i->ToUint32(); }
^
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:9035:22: note: 'ToUint32'
has been explicitly marked deprecated here
Local<Uint32> Value::ToUint32() const {
^
In file included from ../src/bufferutil.cc:16:
In file included from ../node_modules/nan/nan.h:82:
In file included from ../node_modules/nan/nan_new.h:189:
../node_modules/nan/nan_implementation_12_inl.h:49:29: warning: 'New' is
deprecated [-Wdeprecated-declarations]
return v8::BooleanObject::New(value).As<v8::BooleanObject>();
^
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:4490:56: note: 'New' has
been explicitly marked deprecated here
V8_DEPRECATED("Pass an isolate", static Local<Value> New(bool value));
^
In file included from ../src/bufferutil.cc:16:
In file included from ../node_modules/nan/nan.h:82:
In file included from ../node_modules/nan/nan_new.h:189:
../node_modules/nan/nan_implementation_12_inl.h:166:30: warning: 'Compile' is
deprecated [-Wdeprecated-declarations]
return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &src);
^
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:1376:21: note: 'Compile'
has been explicitly marked deprecated here
Local<Script> Compile(Isolate* isolate, Source* source,
^
In file included from ../src/bufferutil.cc:16:
In file included from ../node_modules/nan/nan.h:82:
In file included from ../node_modules/nan/nan_new.h:189:
../node_modules/nan/nan_implementation_12_inl.h:173:30: warning: 'Compile' is
deprecated [-Wdeprecated-declarations]
return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &src);
^
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:1376:21: note: 'Compile'
has been explicitly marked deprecated here
Local<Script> Compile(Isolate* isolate, Source* source,
^
In file included from ../src/bufferutil.cc:16:
In file included from ../node_modules/nan/nan.h:82:
In file included from ../node_modules/nan/nan_new.h:189:
../node_modules/nan/nan_implementation_12_inl.h:205:22: warning:
'NewFromOneByte' is deprecated [-Wdeprecated-declarations]
return v8::String::NewFromOneByte(v8::Isolate::GetCurrent(), value,
^
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:2544:21: note:
'NewFromOneByte' has been explicitly marked deprecated here
Local<String> NewFromOneByte(Isolate* isolate, const uint8_t* data,
^
In file included from ../src/bufferutil.cc:16:
In file included from ../node_modules/nan/nan.h:82:
In file included from ../node_modules/nan/nan_new.h:189:
../node_modules/nan/nan_implementation_12_inl.h:217:22: warning: 'NewExternal'
is deprecated [-Wdeprecated-declarations]
return v8::String::NewExternal(v8::Isolate::GetCurrent(), value);
^
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:2582:38: note:
'NewExternal' has been explicitly marked deprecated here
Local<String> NewExternal(
^
In file included from ../src/bufferutil.cc:16:
In file included from ../node_modules/nan/nan.h:82:
In file included from ../node_modules/nan/nan_new.h:189:
../node_modules/nan/nan_implementation_12_inl.h:237:30: warning:
'CompileUnbound' is deprecated [-Wdeprecated-declarations]
return v8::ScriptCompiler::CompileUnbound(v8::Isolate::GetCurrent(), &src);
^
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:1356:45: note:
'CompileUnbound' has been explicitly marked deprecated here
Local<UnboundScript> CompileUnbound(
^
In file included from ../src/bufferutil.cc:16:
In file included from ../node_modules/nan/nan.h:82:
In file included from ../node_modules/nan/nan_new.h:189:
../node_modules/nan/nan_implementation_12_inl.h:244:30: warning:
'CompileUnbound' is deprecated [-Wdeprecated-declarations]
return v8::ScriptCompiler::CompileUnbound(v8::Isolate::GetCurrent(), &src);
^
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:1356:45: note:
'CompileUnbound' has been explicitly marked deprecated here
Local<UnboundScript> CompileUnbound(
^
In file included from ../src/bufferutil.cc:16:
../node_modules/nan/nan.h:261:25: error: redefinition of '_NanEnsureLocal'
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
^
../node_modules/nan/nan.h:256:25: note: previous definition is here
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) {
^
../node_modules/nan/nan.h:289:39: warning: 'IdleNotification' is deprecated
[-Wdeprecated-declarations]
return v8::Isolate::GetCurrent()->IdleNotification(idle_time_in_ms);
^
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:6893:22: note:
'IdleNotification' has been explicitly marked deprecated here
bool IdleNotification(int idle_time_in_ms));
^
In file included from ../src/bufferutil.cc:16:
../node_modules/nan/nan.h:473:20: error: no type named 'GCEpilogueCallback' in
'v8::Isolate'
v8::Isolate::GCEpilogueCallback callback
~~~~~~~~~~~~~^
../node_modules/nan/nan.h:479:20: error: no type named 'GCEpilogueCallback' in
'v8::Isolate'
v8::Isolate::GCEpilogueCallback callback) {
~~~~~~~~~~~~~^
../node_modules/nan/nan.h:484:20: error: no type named 'GCPrologueCallback' in
'v8::Isolate'
v8::Isolate::GCPrologueCallback callback
~~~~~~~~~~~~~^
../node_modules/nan/nan.h:490:20: error: no type named 'GCPrologueCallback' in
'v8::Isolate'
v8::Isolate::GCPrologueCallback callback) {
~~~~~~~~~~~~~^
../node_modules/nan/nan.h:569:15: error: no type named 'WeakCallbackData' in
namespace 'v8'
const v8::WeakCallbackData<T, _NanWeakCallbackInfo<T, P> > &data) {
~~~~^
../node_modules/nan/nan.h:569:31: error: expected ')'
const v8::WeakCallbackData<T, _NanWeakCallbackInfo<T, P> > &data) {
^
../node_modules/nan/nan.h:568:41: note: to match this '('
static void _NanWeakCallbackDispatcher(
^
../node_modules/nan/nan.h:570:42: error: use of undeclared identifier 'data'
_NanWeakCallbackInfo<T, P> *info = data.GetParameter();
^
../node_modules/nan/nan.h:661:13: error: no member named 'smalloc' in namespace
'node'
, node::smalloc::FreeCallback callback
~~~~~~^
../node_modules/nan/nan.h:672:12: error: no matching function for call to 'New'
return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
^~~~~~~~~~~~~~~~~
/Users/cc/.node-gyp/7.9.0/include/node/node_buffer.h:46:40: note:
candidate function not viable: 2nd argument ('const char *') would lose
const qualifier
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
^
/Users/cc/.node-gyp/7.9.0/include/node/node_buffer.h:34:40: note:
candidate function not viable: no known conversion from 'const char *' to
'v8::Local<v8::String>' for 2nd argument
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
^
/Users/cc/.node-gyp/7.9.0/include/node/node_buffer.h:31:40: note:
candidate function not viable: requires 2 arguments, but 3 were provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate, size_t length);
^
/Users/cc/.node-gyp/7.9.0/include/node/node_buffer.h:39:40: note:
candidate function not viable: requires 5 arguments, but 3 were provided
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
^
In file included from ../src/bufferutil.cc:16:
../node_modules/nan/nan.h:676:12: error: no viable conversion from returned
value of type 'v8::MaybeLocal<v8::Object>' to function return type
'v8::Local<v8::Object>'
return node::Buffer::New(v8::Isolate::GetCurrent(), size);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:221:7: note: candidate
constructor (the implicit copy constructor) not viable: no known
conversion from 'v8::MaybeLocal<v8::Object>' to 'const
v8::Local<v8::Object> &' for 1st argument
class Local {
^
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:221:7: note: candidate
constructor (the implicit move constructor) not viable: no known
conversion from 'v8::MaybeLocal<v8::Object>' to 'v8::Local<v8::Object> &&'
for 1st argument
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:225:13: note: candidate
template ignored: could not match 'Local' against 'MaybeLocal'
V8_INLINE Local(Local<S> that)
^
In file included from ../src/bufferutil.cc:16:
../node_modules/nan/nan.h:683:26: error: no member named 'Use' in namespace
'node::Buffer'
return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
~~~~~~~~~~~~~~^
../node_modules/nan/nan.h:710:32: warning: 'Compile' is deprecated
[-Wdeprecated-declarations]
return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &source);
^
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:1376:21: note: 'Compile'
has been explicitly marked deprecated here
Local<Script> Compile(Isolate* isolate, Source* source,
^
In file included from ../src/bufferutil.cc:16:
../node_modules/nan/nan.h:717:32: warning: 'Compile' is deprecated
[-Wdeprecated-declarations]
return v8::ScriptCompiler::Compile(v8::Isolate::GetCurrent(), &source);
^
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:1376:21: note: 'Compile'
has been explicitly marked deprecated here
Local<Script> Compile(Isolate* isolate, Source* source,
^
../src/bufferutil.cc:30:5: error: call to 'NODE_SET_METHOD' is ambiguous
NODE_SET_METHOD(t, "unmask", BufferUtil::Unmask);
^~~~~~~~~~~~~~~
/Users/cc/.node-gyp/7.9.0/include/node/node.h:266:25: note: expanded
from macro 'NODE_SET_METHOD'
#define NODE_SET_METHOD node::NODE_SET_METHOD
^~~~~~~~~~~~~~~~~~~~~
/Users/cc/.node-gyp/7.9.0/include/node/node.h:241:13: note: candidate
function
inline void NODE_SET_METHOD(v8::Local<v8::Template> recv,
^
/Users/cc/.node-gyp/7.9.0/include/node/node.h:254:13: note: candidate
function
inline void NODE_SET_METHOD(v8::Local<v8::Object> recv,
^
../src/bufferutil.cc:31:5: error: call to 'NODE_SET_METHOD' is ambiguous
NODE_SET_METHOD(t, "mask", BufferUtil::Mask);
^~~~~~~~~~~~~~~
/Users/cc/.node-gyp/7.9.0/include/node/node.h:266:25: note: expanded
from macro 'NODE_SET_METHOD'
#define NODE_SET_METHOD node::NODE_SET_METHOD
^~~~~~~~~~~~~~~~~~~~~
/Users/cc/.node-gyp/7.9.0/include/node/node.h:241:13: note: candidate
function
inline void NODE_SET_METHOD(v8::Local<v8::Template> recv,
^
/Users/cc/.node-gyp/7.9.0/include/node/node.h:254:13: note: candidate
function
inline void NODE_SET_METHOD(v8::Local<v8::Object> recv,
^
../src/bufferutil.cc:32:5: error: call to 'NODE_SET_METHOD' is ambiguous
NODE_SET_METHOD(t, "merge", BufferUtil::Merge);
^~~~~~~~~~~~~~~
/Users/cc/.node-gyp/7.9.0/include/node/node.h:266:25: note: expanded
from macro 'NODE_SET_METHOD'
#define NODE_SET_METHOD node::NODE_SET_METHOD
^~~~~~~~~~~~~~~~~~~~~
/Users/cc/.node-gyp/7.9.0/include/node/node.h:241:13: note: candidate
function
inline void NODE_SET_METHOD(v8::Local<v8::Template> recv,
^
/Users/cc/.node-gyp/7.9.0/include/node/node.h:254:13: note: candidate
function
inline void NODE_SET_METHOD(v8::Local<v8::Object> recv,
^
In file included from ../src/bufferutil.cc:7:
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:232:5: error: assigning to
'v8::Primitive *volatile' from incompatible type 'v8::Value *'
TYPE_CHECK(T, S);
^~~~~~~~~~~~~~~~
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:191:37: note: expanded from
macro 'TYPE_CHECK'
*(static_cast<T* volatile*>(0)) = static_cast<S*>(0); \
^ ~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:414:12: note: in instantiation of function template
specialization 'v8::Local<v8::Primitive>::Local<v8::Value>' requested here
return NanEscapeScope(NanNew(v8::Undefined(v8::Isolate::GetCurrent())));
^
../node_modules/nan/nan.h:398:30: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
^
In file included from ../src/bufferutil.cc:7:
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:232:5: error: assigning to
'v8::Boolean *volatile' from incompatible type 'v8::Value *'
TYPE_CHECK(T, S);
^~~~~~~~~~~~~~~~
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:191:37: note: expanded from
macro 'TYPE_CHECK'
*(static_cast<T* volatile*>(0)) = static_cast<S*>(0); \
^ ~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:424:12: note: in instantiation of function template
specialization 'v8::Local<v8::Boolean>::Local<v8::Value>' requested here
return NanEscapeScope(NanNew(v8::True(v8::Isolate::GetCurrent())));
^
../node_modules/nan/nan.h:398:30: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
^
In file included from ../src/bufferutil.cc:7:
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:232:5: error: assigning to
'v8::Function *volatile' from incompatible type 'v8::Value *'
TYPE_CHECK(T, S);
^~~~~~~~~~~~~~~~
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:191:37: note: expanded from
macro 'TYPE_CHECK'
*(static_cast<T* volatile*>(0)) = static_cast<S*>(0); \
^ ~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:1514:12: note: in instantiation of function template
specialization 'v8::Local<v8::Function>::Local<v8::Value>' requested here
return NanEscapeScope(NanNew(handle)->Get(kCallbackIndex)
^
../node_modules/nan/nan.h:398:30: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
^
In file included from ../src/bufferutil.cc:7:
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:232:5: error: assigning to
'v8::Object *volatile' from incompatible type 'v8::Value *'
TYPE_CHECK(T, S);
^~~~~~~~~~~~~~~~
/Users/cc/.node-gyp/7.9.0/include/node/v8.h:191:37: note: expanded from
macro 'TYPE_CHECK'
*(static_cast<T* volatile*>(0)) = static_cast<S*>(0); \
^ ~~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:1632:12: note: in instantiation of function template
specialization 'v8::Local<v8::Object>::Local<v8::Value>' requested here
return NanEscapeScope(handle->Get(NanNew(key)).As<v8::Object>());
^
../node_modules/nan/nan.h:398:30: note: expanded from macro 'NanEscapeScope'
# define NanEscapeScope(val) scope.Escape(_NanEnsureLocal(val))
^
12 warnings and 19 errors generated.
make: *** [Release/obj.target/bufferutil/src/bufferutil.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:194:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Darwin 16.5.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/cc/project/node_modules/bufferutil
gyp ERR! node -v v7.9.0
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok

npm install - error This version of node/NAN/v8 requires a C++11 compiler libxmljs#0.18.0 node-gyp rebuild

I'm running CentOS 6.8(Final) using Vagrant/VirtualBox.
GCC compiler version is (v4.4.7)
Node version (latest LTS): v4.4.6
My package.json file has:
{
"name": "njse",
"main": "server.js",
"description": "MyCompany services",
"repository": "",
"license": "",
"dependencies": {
"bunyan": "^1.8.1",
"dns": "^0.2.2",
"express": "~4.0.0",
"express-delay": "~0.1.0",
"libxmljs": "^0.18.0",
"mssql": "^3.3.0",
"ping": "^0.1.10",
"powershell": "^2.0.2",
"q": "^1.4.1",
"q-io": "^1.13.2",
"validatorjs": "^2.0.11",
"xml2js": "^0.4.16"
}
}
While running "npm install" or "sudo ~vagrant/bin/npm install" I'm getting the following errors.
Any ideas what should I do to fix this issue and run "npm install" successfully? Thanks.
Log:(with some truncation of log files to fit the word limit for this post)
[vagrant#localhost my-directory]$ npm install
npm WARN package.json njse# No repository field.
npm WARN package.json njse# No README data
npm WARN package.json njse# No license field.
npm WARN engine dns#0.2.2: wanted: {"node":">= 0.10.0 < 0.11.0"} (current: {"node":"4.4.6","npm":"2.15.5"})
npm WARN engine tomahawk#0.1.6: wanted: {"node":">= 0.8.0 < 0.11.0"} (current: {"node":"4.4.6","npm":"2.15.5"})
npm WARN engine hawk#0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"4.4.6","npm":"2.15.5"})
npm WARN engine sntp#0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"4.4.6","npm":"2.15.5"})
npm WARN engine cryptiles#0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"4.4.6","npm":"2.15.5"})
npm WARN engine boom#0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"4.4.6","npm":"2.15.5"})
npm WARN engine hoek#0.7.6: wanted: {"node":"0.8.x"} (current: {"node":"4.4.6","npm":"2.15.5"})
> dtrace-provider#0.6.0 install /home/vagrant/ws/06272016/my-directory/node_modules/bunyan/node_modules/dtrace-provider
> node scripts/install.js
> libxmljs#0.18.0 install /home/vagrant/ws/06272016/my-directory/node_modules/libxmljs
> node-gyp rebuild
make: Entering directory `/home/vagrant/ws/06272016/my-directory/node_modules/libxmljs/build'
CC(target) Release/obj.target/libxml/vendor/libxml/buf.o
CC(target) Release/obj.target/libxml/vendor/libxml/catalog.o
CC(target) Release/obj.target/libxml/vendor/libxml/xmlschemas.o
CC(target) Release/obj.target/libxml/vendor/libxml/xmlschemastypes.o
CC(target) Release/obj.target/libxml/vendor/libxml/xmlstring.o
CC(target) Release/obj.target/libxml/vendor/libxml/xmlunicode.o
CC(target) Release/obj.target/libxml/vendor/libxml/xmlwriter.o
CC(target) Release/obj.target/libxml/vendor/libxml/xpath.o
In file included from ../vendor/libxml/xpath.c:462:
../vendor/libxml/timsort.h: In function ‘libxml_domnode_tim_sort_collapse’:
../vendor/libxml/timsort.h:405: warning: comparison between signed and unsigned integer expressions
../vendor/libxml/xpath.c: At top level:
../vendor/libxml/trionan.c:218: warning: ‘trio_is_negative’ defined but not used
../vendor/libxml/xpath.c: In function ‘xmlXPathCastNumberToString’:
../vendor/libxml/xpath.c:3197: warning: array subscript is above array bounds
CC(target) Release/obj.target/libxml/vendor/libxml/xpointer.o
AR(target) Release/obj.target/vendor/libxml/xml.a
COPY Release/xml.a
CXX(target) Release/obj.target/xmljs/src/libxmljs.o
In file included from ../src/libxmljs.h:7,
from ../src/libxmljs.cc:7:
../node_modules/nan/nan.h:43:3: error: #error This version of node/NAN/v8 requires a C++11 compiler
In file included from ../src/libxmljs.cc:3:
/home/vagrant/.node-gyp/4.4.6/include/node/v8.h:336: error: expected unqualified-id before ‘using’
/home/vagrant/.node-gyp/4.4.6/include/node/v8.h: In constructor ‘v8::MaybeLocal<T>::MaybeLocal()’:
/home/vagrant/.node-gyp/4.4.6/include/node/v8.h:353: error: ‘nullptr’ was not declared in this scope
/home/vagrant/.node-gyp/4.4.6/include/node/v8.h: In member function ‘bool v8::MaybeLocal<T>::IsEmpty() const’:
/home/vagrant/.node-gyp/4.4.6/include/node/v8.h:360: error: ‘nullptr’ was not declared in this scope
/home/vagrant/.node-gyp/4.4.6/include/node/v8.h: In member function ‘bool v8::MaybeLocal<T>::ToLocal(v8::Local<S>*) const’:
/home/vagrant/.node-gyp/4.4.6/include/node/v8.h:364: error: ‘nullptr’ was not declared in this scope
/home/vagrant/.node-gyp/4.4.6/include/node/v8.h: In member function ‘bool v8::WeakCallbackInfo<T>::IsFirstPass() const’:
/home/vagrant/.node-gyp/4.4.6/include/node/v8.h:430: error: ‘nullptr’ was not declared in this scope
/home/vagrant/.node-gyp/4.4.6/include/node/v8.h: At global scope:
/home/vagrant/.node-gyp/4.4.6/include/node/v8.h:469: error: expected unqualified-id before ‘using’
/home/vagrant/.node-gyp/4.4.6/include/node/v8.h: In constructor ‘v8::Global<T>::Global()’:
/home/vagrant/.node-gyp/4.4.6/include/node/v8.h:790: error: ‘nullptr’ was not declared in this scope
/home/vagrant/.node-gyp/4.4.6/include/node/v8.h: In constructor ‘v8::Global<T>::Global(v8::Global<T>&&)’:
/home/vagrant/.node-gyp/4.4.6/include/node/v8.h:815: error: ‘nullptr’ was not declared in this scope
/home/vagrant/.node-gyp/4.4.6/include/node/v8.h: In member function ‘v8::Global<T>& v8::Global<T>::operator=(v8::Global<S>&&)’:
/home/vagrant/.node-gyp/4.4.6/include/node/v8.h:827: error: ‘nullptr’ was not declared in this scope
/home/vagrant/.node-gyp/4.4.6/include/node/v8.h: At global scope:
/home/vagrant/.node-gyp/4.4.6/include/node/v8.h:852: error: expected unqualified-id before ‘using’
/home/vagrant/.node-gyp/4.4.6/include/node/v8.h:1089: error: ‘nullptr’ was not declared in this scope
/home/vagrant/.node-gyp/4.4.6/include/node/v8.h:1095: error: ‘nullptr’ was not declared in this scope
/home/vagrant/.node-gyp/4.4.6/include/node/v8.h: In member function ‘v8::MaybeLocal<v8::Object> v8::Function::NewInstance(v8::Local<v8::Context>) const’:
/home/vagrant/.node-gyp/4.4.6/include/node/v8.h:3205: error: ‘nullptr’ was not declared in this scope
/home/vagrant/.node-gyp/4.4.6/include/node/v8.h: In member function ‘v8::Local<T> v8::MaybeLocal<T>::ToLocalChecked()’:
/home/vagrant/.node-gyp/4.4.6/include/node/v8.h:7164: error: ‘nullptr’ was not declared in this scope
In file included from ../node_modules/nan/nan.h:196,
from ../src/libxmljs.h:7,
from ../src/libxmljs.cc:7:
../node_modules/nan/nan_maybe_43_inl.h: At global scope:
../node_modules/nan/nan_maybe_43_inl.h:13: error: expected unqualified-id before ‘using’
../node_modules/nan/nan_maybe_43_inl.h:16: error: expected unqualified-id before ‘using’
../node_modules/nan/nan_maybe_43_inl.h:19: error: expected initializer before ‘<’ token
../node_modules/nan/nan_maybe_43_inl.h:24: error: expected initializer before ‘<’ token
../node_modules/nan/nan_maybe_43_inl.h:83: error: expected initializer before ‘<’ token
../node_modules/nan/nan_maybe_43_inl.h:91: error: expected initializer before ‘<’ token
../node_modules/nan/nan_maybe_43_inl.h:98: error: expected initializer before ‘<’ token
../node_modules/nan/nan_maybe_43_inl.h:108: error: expected initializer before ‘<’ token
../node_modules/nan/nan_maybe_43_inl.h:114: error: expected initializer before ‘<’ token
../node_modules/nan/nan_maybe_43_inl.h:118: error: expected initializer before ‘<’ token
../node_modules/nan/nan_maybe_43_inl.h:125: error: expected initializer before ‘<’ token
../node_modules/nan/nan_maybe_43_inl.h:130: error: expected initializer before ‘<’ token
../node_modules/nan/nan_maybe_43_inl.h:135: error: expected initializer before ‘<’ token
../node_modules/nan/nan_maybe_43_inl.h:139: error: expected initializer before ‘<’ token
../node_modules/nan/nan_maybe_43_inl.h:145: error: expected initializer before ‘<’ token
../node_modules/nan/nan_maybe_43_inl.h:150: error: expected initializer before ‘<’ token
../node_modules/nan/nan_maybe_43_inl.h:156: error: expected initializer before ‘<’ token
../node_modules/nan/nan_maybe_43_inl.h:162: error: expected initializer before ‘<’ token
../node_modules/nan/nan_maybe_43_inl.h:168: error: expected initializer before ‘<’ token
../node_modules/nan/nan_maybe_43_inl.h:174: error: expected initializer before ‘<’ token
../node_modules/nan/nan_maybe_43_inl.h:180: error: expected initializer before ‘<’ token
../node_modules/nan/nan_maybe_43_inl.h:186: error: expected initializer before ‘<’ token
../node_modules/nan/nan_maybe_43_inl.h:194: error: expected initializer before ‘<’ token
../node_modules/nan/nan_maybe_43_inl.h:201: error: expected initializer before ‘<’ token
../node_modules/nan/nan_maybe_43_inl.h:205: error: expected initializer before ‘<’ token
../node_modules/nan/nan_maybe_43_inl.h:209: error: expected initializer before ‘<’ token
../node_modules/nan/nan_maybe_43_inl.h:213: error: expected initializer before ‘<’ token
../node_modules/nan/nan_maybe_43_inl.h:217: error: expected initializer before ‘<’ token
../node_modules/nan/nan_maybe_43_inl.h:223: error: expected initializer before ‘<’ token
In file included from ../node_modules/nan/nan.h:201,
from ../src/libxmljs.h:7,
from ../src/libxmljs.cc:7:
../node_modules/nan/nan_converters.h:14: error: ISO C++ forbids declaration of ‘MaybeLocal’ with no type
../node_modules/nan/nan_converters.h:14: error: expected ‘;’ before ‘<’ token
../node_modules/nan/nan_converters.h:16: error: ISO C++ forbids declaration of ‘Maybe’ with no type
../node_modules/nan/nan_converters.h:16: error: expected ‘;’ before ‘<’ token
../node_modules/nan/nan_converters.h:26: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:27: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:28: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:29: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:30: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:31: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:32: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:42: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:43: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:44: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:45: error: ‘return_t’ does not name a type
../node_modules/nan/nan_converters.h:46: error: ‘return_t’ does not name a type
In file included from ../node_modules/nan/nan_converters.h:59,
from ../node_modules/nan/nan.h:201,
from ../src/libxmljs.h:7,
from ../src/libxmljs.cc:7:
../node_modules/nan/nan_converters_43_inl.h:18: error: ‘return_t’ in class ‘Nan::imp::ToFactory<v8::Boolean>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:19: error: ‘return_t’ in class ‘Nan::imp::ToFactory<v8::Number>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:20: error: ‘return_t’ in class ‘Nan::imp::ToFactory<v8::String>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:21: error: ‘return_t’ in class ‘Nan::imp::ToFactory<v8::Object>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:22: error: ‘return_t’ in class ‘Nan::imp::ToFactory<v8::Integer>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:23: error: ‘return_t’ in class ‘Nan::imp::ToFactory<v8::Uint32>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:24: error: ‘return_t’ in class ‘Nan::imp::ToFactory<v8::Int32>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:34: error: ‘return_t’ in class ‘Nan::imp::ToFactory<bool>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:35: error: ‘return_t’ in class ‘Nan::imp::ToFactory<double>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:36: error: ‘return_t’ in class ‘Nan::imp::ToFactory<long int>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:37: error: ‘return_t’ in class ‘Nan::imp::ToFactory<unsigned int>’ does not name a type
../node_modules/nan/nan_converters_43_inl.h:38: error: ‘return_t’ in class ‘Nan::imp::ToFactory<int>’ does not name a type
In file included from ../node_modules/nan/nan.h:202,
from ../src/libxmljs.h:7,
from ../src/libxmljs.cc:7:
../node_modules/nan/nan_new.h: In function ‘v8::Local<T> Nan::imp::To(v8::Local<v8::Integer>) [with T = v8::Integer]’:
../node_modules/nan/nan_new.h:21: error: no matching function for call to ‘To(v8::Local<v8::Integer>&)’
../node_modules/nan/nan_new.h: In function ‘v8::Local<T> Nan::imp::To(v8::Local<v8::Integer>) [with T = v8::Int32]’:
../node_modules/nan/nan_new.h:28: error: no matching function for call to ‘To(v8::Local<v8::Integer>&)’
../node_modules/nan/nan_new.h: In function ‘v8::Local<T> Nan::imp::To(v8::Local<v8::Integer>) [with T = v8::Uint32]’:
../node_modules/nan/nan_new.h:35: error: no matching function for call to ‘To(v8::Local<v8::Integer>&)’
../node_modules/nan/nan_new.h: At global scope:
../node_modules/nan/nan_new.h:43: error: ISO C++ forbids declaration of ‘MaybeLocal’ with no type
../node_modules/nan/nan_new.h:43: error: expected ‘;’ before ‘<’ token
../node_modules/nan/nan_new.h:75: error: ‘return_t’ does not name a type
../node_modules/nan/nan_new.h:182: error: ‘return_t’ does not name a type
../node_modules/nan/nan_new.h:183: error: ‘return_t’ does not name a type
In file included from ../node_modules/nan/nan_new.h:189,
from ../node_modules/nan/nan.h:202,
from ../src/libxmljs.h:7,
from ../src/libxmljs.cc:7:
../node_modules/nan/nan_implementation_12_inl.h:56: error: ‘return_t’ in class ‘Nan::imp::Factory<v8::Date>’ does not name a type
../node_modules/nan/nan_implementation_12_inl.h: In static member function ‘static v8::Local<v8::Function> Nan::imp::Factory<v8::Function>::New(void (*)(const Nan::FunctionCallbackInfo<v8::Value>&), v8::Local<v8::Value>)’:
../node_modules/nan/nan_implementation_12_inl.h:90: error: ‘NewInstance’ was not declared in this scope
../node_modules/nan/nan_implementation_12_inl.h: In static member function ‘static v8::Local<v8::FunctionTemplate> Nan::imp::Factory<v8::FunctionTemplate>::New(void (*)(const Nan::FunctionCallbackInfo<v8::Value>&), v8::Local<v8::Value>, v8::Local<v8::Signature>)’:
../node_modules/nan/nan_implementation_12_inl.h:118: error: ‘NewInstance’ was not declared in this scope
../node_modules/nan/nan_implementation_12_inl.h: At global scope:
../node_modules/nan/nan_implementation_12_inl.h:197: error: ‘return_t’ in class ‘Nan::imp::Factory<v8::RegExp>’ does not name a type
../node_modules/nan/nan_implementation_12_inl.h:216: error: ‘return_t’ in
../node_modules/nan/nan_implementation_12_inl.h:275: error: ‘return_t’ in class ‘Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_implementation_12_inl.h:281: error: ‘return_t’ in class ‘Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_implementation_12_inl.h:286: error: ‘return_t’ in class ‘Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_implementation_12_inl.h:347: error: ‘return_t’ in class ‘Nan::imp::Factory<v8::UnboundScript>’ does not name a type
../node_modules/nan/nan_implementation_12_inl.h:354: error: ‘return_t’ in class ‘Nan::imp::Factory<v8::UnboundScript>’ does not name a type
In file included from ../node_modules/nan/nan.h:202,
from ../src/libxmljs.h:7,
from ../src/libxmljs.cc:7:
../node_modules/nan/nan_new.h:293: error: ‘return_t’ in class ‘Nan::imp::Factory<v8::String>’ does not name a type
../node_modules/nan/nan_new.h:299: error: ‘return_t’ in
../node_modules/nan/nan_new.h:335: error: ‘return_t’ in class ‘Nan::imp::Factory<v8::RegExp>’ does not name a type
In file included from ../src/libxmljs.h:7,
from ../src/libxmljs.cc:7:
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> Nan::Error(const char*)’:
../node_modules/nan/nan.h:661: error: ‘class v8::Local<v8::Boolean>’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘void Nan::ThrowError(const char*)’:
../node_modules/nan/nan.h:661: error: ‘class v8::Local<v8::Boolean>’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> Nan::RangeError(const char*)’:
../node_modules/nan/nan.h:662: error: ‘class v8::Local<v8::Boolean>’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘void Nan::ThrowRangeError(const char*)’:
../node_modules/nan/nan.h:662: error: ‘class v8::Local<v8::Boolean>’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> Nan::ReferenceError(const char*)’:
../node_modules/nan/nan.h:663: error: ‘class v8::Local<v8::Boolean>’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘void Nan::ThrowReferenceError(const char*)’:
../node_modules/nan/nan.h:663: error: ‘class v8::Local<v8::Boolean>’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> Nan::SyntaxError(const char*)’:
../node_modules/nan/nan.h:664: error: ‘class v8::Local<v8::Boolean>’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘void Nan::ThrowSyntaxError(const char*)’:
../node_modules/nan/nan.h:664: error: ‘class v8::Local<v8::Boolean>’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘v8::Local<v8::Value> Nan::TypeError(const char*)’:
../node_modules/nan/nan.h:665: error: ‘class v8::Local<v8::Boolean>’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘void Nan::ThrowTypeError(const char*)’:
../node_modules/nan/nan.h:665: error: ‘class v8::Local<v8::Boolean>’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: At global scope:
../node_modules/nan/nan.h:673: error: expected initializer before ‘<’ token
../node_modules/nan/nan.h:695: error: expected initializer before ‘<’ token
../node_modules/nan/nan.h:762: error: expected initializer before ‘<’ token
../node_modules/nan/nan.h:768: error: expected initializer before ‘<’ token
/home/vagrant/.node-gyp/4.4.6/include/node/v8.h: In member function ‘void Nan::Callback::SetFunction(const v8::Local<v8::Function>&)’:
/home/vagrant/.node-gyp/4.4.6/include/node/v8.h:3021: error: argument dependent lookup finds ‘class v8::Set’
../node_modules/nan/nan.h:1404: error: in call to ‘Set’
../node_modules/nan/nan.h: In member function ‘void Nan::AsyncWorker::SaveToPersistent(const char*, const v8::Local<v8::Value>&)’:
../node_modules/nan/nan.h:1524: error: ‘class v8::Local<v8::Boolean>’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In member function ‘v8::Local<v8::Value> Nan::AsyncWorker::GetFromPersistent(const char*) const’:
../node_modules/nan/nan.h:1542: error: ‘class v8::Local<v8::Boolean>’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In member function ‘virtual void Nan::AsyncWorker::HandleErrorCallback()’:
../node_modules/nan/nan.h:1576: error: no matching function for call to ‘New(const char*)’
../node_modules/nan/nan.h: In function ‘void Nan::SetMethod(v8::Local<v8::Object>, const char*, void (*)(const Nan::FunctionCallbackInfo<v8::Value>&))’:
../node_modules/nan/nan.h:1896: error: ‘GetFunction’ was not declared in this scope
../node_modules/nan/nan.h:1897: error: ‘class v8::Local<v8::Boolean>’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘void Nan::SetMethod(v8::Local<v8::FunctionTemplate>, const char*, void (*)(const Nan::FunctionCallbackInfo<v8::Value>&))’:
../node_modules/nan/nan.h:1908: error: ‘class v8::Local<v8::Boolean>’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘void Nan::SetMethod(v8::Local<v8::ObjectTemplate>, const char*, void (*)(const Nan::FunctionCallbackInfo<v8::Value>&))’:
../node_modules/nan/nan.h:1919: error: ‘class v8::Local<v8::Boolean>’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘void Nan::SetPrototypeMethod(v8::Local<v8::FunctionTemplate>, const char*, void (*)(const Nan::FunctionCallbackInfo<v8::Value>&))’:
../node_modules/nan/nan.h:1933: error: ‘class v8::Local<v8::Boolean>’ has no member named ‘ToLocalChecked’
../node_modules/nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, void (*)(v8::Local<v8::String>, const Nan::PropertyCallbackInfo<v8::Value>&), void (*)(v8::Local<v8::String>, v8::Local<v8::Value>, const Nan::PropertyCallbackInfo<void>&), v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, Nan::imp::Sig)’:
../node_modules/nan/nan.h:1958: error: ‘NewInstance’ was not declared in this scope
../node_modules/nan/nan.h: In function ‘bool Nan::SetAccessor(v8::Local<v8::Object>, v8::Local<v8::String>, void (*)(v8::Local<v8::String>, const Nan::PropertyCallbackInfo<v8::Value>&), void (*)(v8::Local<v8::String>, v8::Local<v8::Value>, const Nan::PropertyCallbackInfo<void>&), v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute)’:
../node_modules/nan/nan.h:2001: error: ‘NewInstance’ was not declared in this scope
../node_modules/nan/nan.h: In function ‘void Nan::SetNamedPropertyHandler(v8::Local<v8::ObjectTemplate>, void (*)(v8::Local<v8::String>, const Nan::PropertyCallbackInfo<v8::Value>&), void (*)(v8::Local<v8::String>, v8::Local<v8::Value>, const Nan::PropertyCallbackInfo<v8::Value>&), void (*)(v8::Local<v8::String>, const Nan::PropertyCallbackInfo<v8::Integer>&), void (*)(v8::Local<v8::String>, const Nan::PropertyCallbackInfo<v8::Boolean>&), void (*)(const Nan::PropertyCallbackInfo<v8::Array>&), v8::Local<v8::Value>)’:
../node_modules/nan/nan.h:2049: error: ‘NewInstance’ was not declared in this scope
../node_modules/nan/nan.h: In function ‘void Nan::SetIndexedPropertyHandler(v8::Local<v8::ObjectTemplate>, void (*)(uint32_t, const Nan::PropertyCallbackInfo<v8::Value>&), void (*)(uint32_t, v8::Local<v8::Value>, const Nan::PropertyCallbackInfo<v8::Value>&), void (*)(uint32_t, const Nan::PropertyCallbackInfo<v8::Integer>&), void (*)(uint32_t, const Nan::PropertyCallbackInfo<v8::Boolean>&), void (*)(const Nan::PropertyCallbackInfo<v8::Array>&), v8::Local<v8::Value>)’:
../node_modules/nan/nan.h:2119: error: ‘NewInstance’ was not declared in this scope
../node_modules/nan/nan.h: In function ‘void Nan::SetCallHandler(v8::Local<v8::FunctionTemplate>, void (*)(const Nan::FunctionCallbackInfo<v8::Value>&), v8::Local<v8::Value>)’:
../node_modules/nan/nan.h:2174: error: ‘NewInstance’ was not declared in this scope
../node_modules/nan/nan.h: In function ‘void Nan::SetCallAsFunctionHandler(v8::Local<v8::ObjectTemplate>, void (*)(const Nan::FunctionCallbackInfo<v8::Value>&), v8::Local<v8::Value>)’:
../node_modules/nan/nan.h:2196: error: ‘NewInstance’ was not declared in this scope
In file included from ../src/libxmljs.h:7,
from ../src/libxmljs.cc:7:
../node_modules/nan/nan.h: In function ‘void Nan::Export(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE, const char*, void (*)(const Nan::FunctionCallbackInfo<v8::Value>&))’:
../node_modules/nan/nan.h:2223: error: no matching function for call to ‘New(const char*&)’
../node_modules/nan/nan.h:2224: error: ‘GetFunction’ was not declared in this scope
/home/vagrant/.node-gyp/4.4.6/include/node/v8.h:3021: error: argument dependent lookup finds ‘class v8::Set’
../node_modules/nan/nan.h:2224: error: in call to ‘Set’
../node_modules/nan/nan.h: In constructor ‘Nan::Tap::Tap(v8::Local<v8::Value>)’:
../node_modules/nan/nan.h:2231: error: no matching function for call to ‘To(v8::Local<v8::Value>&)’
../src/libxmljs.cc:263: error: ‘Set’ is not a member of ‘Nan’
../src/libxmljs.cc:263: error: no matching function for call to ‘New(const char [7])’
make: *** [Release/obj.target/xmljs/src/libxmljs.o] Error 1
make: Leaving directory `/home/vagrant/ws/06272016/my-directory/node_modules/libxmljs/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/vagrant/tools/node-v4.4.6-linux-x64/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
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 Linux 2.6.32-573.7.1.el6.x86_64
gyp ERR! command "/home/vagrant/tools/node-v4.4.6-linux-x64/bin/node" "/home/vagrant/tools/node-v4.4.6-linux-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/vagrant/ws/06272016/my-directory/node_modules/libxmljs
gyp ERR! node -v v4.4.6
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok
> ws#0.4.31 install /home/vagrant/ws/06272016/my-directory/node_modules/dns/node_modules/tomahawk/node_modules/socket.io/node_modules/engine.io/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory `/home/vagrant/ws/06272016/my-directory/node_modules/dns/node_modules/tomahawk/node_modules/socket.io/node_modules/engine.io/node_modules/ws/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
make: Leaving directory `/home/vagrant/ws/06272016/my-directory/node_modules/dns/node_modules/tomahawk/node_modules/socket.io/node_modules/engine.io/node_modules/ws/build'
> ws#0.4.31 install /home/vagrant/ws/06272016/my-directory/node_modules/dns/node_modules/tomahawk/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory `/home/vagrant/ws/06272016/my-directory/node_modules/dns/node_modules/tomahawk/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
make: Leaving directory `/home/vagrant/ws/06272016/my-directory/node_modules/dns/node_modules/tomahawk/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/build'
npm ERR! Linux 2.6.32-573.7.1.el6.x86_64
npm ERR! argv "/home/vagrant/tools/node-v4.4.6-linux-x64/bin/node" "/home/vagrant/bin/npm" "install"
npm ERR! node v4.4.6
npm ERR! npm v2.15.5
npm ERR! code ELIFECYCLE
npm ERR! libxmljs#0.18.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the libxmljs#0.18.0 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the libxmljs 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 information on how to open an issue for this project with:
npm ERR! npm bugs libxmljs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls libxmljs
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/vagrant/ws/06272016/my-directory/npm-debug.log
[vagrant#localhost my-directory]$ sudo yum install libxmljs
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: chicago.gaminghost.co
* epel: mirror.oss.ou.edu
* extras: mirrors.adams.net
* updates: centos.pymesolutionsweb.com
No package libxmljs available.
Error: Nothing to do
[vagrant#localhost my-directory]$ which gcc
/usr/bin/gcc
[vagrant#localhost my-directory]$ gcc --version
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17)
Tried upgrading/install of gcc using (yum), it says:
Package gcc-4.4.7-17.el6.x86_64 already installed and latest version
One of the post says, I may need to install gcc 4.8 or newer to build binary addons for node 4.x and above? Is that really required, if so, how can I efficiently install gcc 4.8 without breaking anything else? I also see there's devtoolset-3-rebuild version available on CentOS site. devtoolset-2 has KNOWN issues as per the post: https://superuser.com/questions/381160/how-to-install-gcc-4-7-x-4-8-x-on-centos
I had the same error on my Linux server:
> node-gyp rebuild
...
../node_modules/nan/nan.h:43:3: error: #error This version of node/NAN/v8 requires a C++11 compiler
This helped me:
$ scl enable devtoolset-2 bash
We did a mistake and passed .c extension file changing extension of those files to .cpp fixed this issue for us.

Resources