title: npm install - error This version of node/NAN/v8 requires a C++11 compiler libxmljs@0.18.0 node-gyp rebuild
body: <p>I'm running CentOS 6.8(Final) using Vagrant/VirtualBox.
  GCC compiler version is (v4.4.7)
  Node version (latest LTS): v4.4.6</p>
  
  <p>My package.json file has:</p>
  
  <pre><code>{
    "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"
    }
  }
  </code></pre>
  
  <p>While running "npm install" or "sudo ~vagrant/bin/npm install" I'm getting the following errors. </p>
  
  <p>Any ideas what should I do to fix this issue and run "npm install" successfully? Thanks. </p>
  
  <p><strong>Log:<em></strong>(with some truncation of log files to fit the word limit for this post)</em></p>
  
  <pre><code>[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":"&gt;= 0.10.0 &lt; 0.11.0"} (current: {"node":"4.4.6","npm":"2.15.5"})
  npm WARN engine tomahawk@0.1.6: wanted: {"node":"&gt;= 0.8.0 &lt; 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"})
  
  &gt; dtrace-provider@0.6.0 install /home/vagrant/ws/06272016/my-directory/node_modules/bunyan/node_modules/dtrace-provider
  &gt; node scripts/install.js
  
  
  &gt; libxmljs@0.18.0 install /home/vagrant/ws/06272016/my-directory/node_modules/libxmljs
  &gt; 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&lt;T&gt;::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&lt;T&gt;::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&lt;T&gt;::ToLocal(v8::Local&lt;S&gt;*) 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&lt;T&gt;::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&lt;T&gt;::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&lt;T&gt;::Global(v8::Global&lt;T&gt;&amp;&amp;)’:
  /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&lt;T&gt;&amp; v8::Global&lt;T&gt;::operator=(v8::Global&lt;S&gt;&amp;&amp;)’:
  /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&lt;v8::Object&gt; v8::Function::NewInstance(v8::Local&lt;v8::Context&gt;) 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&lt;T&gt; v8::MaybeLocal&lt;T&gt;::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 ‘&lt;’ token
  ../node_modules/nan/nan_maybe_43_inl.h:24: error: expected initializer before ‘&lt;’ token
  ../node_modules/nan/nan_maybe_43_inl.h:83: error: expected initializer before ‘&lt;’ token
  ../node_modules/nan/nan_maybe_43_inl.h:91: error: expected initializer before ‘&lt;’ token
  ../node_modules/nan/nan_maybe_43_inl.h:98: error: expected initializer before ‘&lt;’ token
  ../node_modules/nan/nan_maybe_43_inl.h:108: error: expected initializer before ‘&lt;’ token
  ../node_modules/nan/nan_maybe_43_inl.h:114: error: expected initializer before ‘&lt;’ token
  ../node_modules/nan/nan_maybe_43_inl.h:118: error: expected initializer before ‘&lt;’ token
  ../node_modules/nan/nan_maybe_43_inl.h:125: error: expected initializer before ‘&lt;’ token
  ../node_modules/nan/nan_maybe_43_inl.h:130: error: expected initializer before ‘&lt;’ token
  ../node_modules/nan/nan_maybe_43_inl.h:135: error: expected initializer before ‘&lt;’ token
  ../node_modules/nan/nan_maybe_43_inl.h:139: error: expected initializer before ‘&lt;’ token
  ../node_modules/nan/nan_maybe_43_inl.h:145: error: expected initializer before ‘&lt;’ token
  ../node_modules/nan/nan_maybe_43_inl.h:150: error: expected initializer before ‘&lt;’ token
  ../node_modules/nan/nan_maybe_43_inl.h:156: error: expected initializer before ‘&lt;’ token
  ../node_modules/nan/nan_maybe_43_inl.h:162: error: expected initializer before ‘&lt;’ token
  ../node_modules/nan/nan_maybe_43_inl.h:168: error: expected initializer before ‘&lt;’ token
  ../node_modules/nan/nan_maybe_43_inl.h:174: error: expected initializer before ‘&lt;’ token
  ../node_modules/nan/nan_maybe_43_inl.h:180: error: expected initializer before ‘&lt;’ token
  ../node_modules/nan/nan_maybe_43_inl.h:186: error: expected initializer before ‘&lt;’ token
  ../node_modules/nan/nan_maybe_43_inl.h:194: error: expected initializer before ‘&lt;’ token
  ../node_modules/nan/nan_maybe_43_inl.h:201: error: expected initializer before ‘&lt;’ token
  ../node_modules/nan/nan_maybe_43_inl.h:205: error: expected initializer before ‘&lt;’ token
  ../node_modules/nan/nan_maybe_43_inl.h:209: error: expected initializer before ‘&lt;’ token
  ../node_modules/nan/nan_maybe_43_inl.h:213: error: expected initializer before ‘&lt;’ token
  ../node_modules/nan/nan_maybe_43_inl.h:217: error: expected initializer before ‘&lt;’ token
  ../node_modules/nan/nan_maybe_43_inl.h:223: error: expected initializer before ‘&lt;’ 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 ‘&lt;’ 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 ‘&lt;’ 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&lt;v8::Boolean&gt;’ does not name a type
  ../node_modules/nan/nan_converters_43_inl.h:19: error: ‘return_t’ in class ‘Nan::imp::ToFactory&lt;v8::Number&gt;’ does not name a type
  ../node_modules/nan/nan_converters_43_inl.h:20: error: ‘return_t’ in class ‘Nan::imp::ToFactory&lt;v8::String&gt;’ does not name a type
  ../node_modules/nan/nan_converters_43_inl.h:21: error: ‘return_t’ in class ‘Nan::imp::ToFactory&lt;v8::Object&gt;’ does not name a type
  ../node_modules/nan/nan_converters_43_inl.h:22: error: ‘return_t’ in class ‘Nan::imp::ToFactory&lt;v8::Integer&gt;’ does not name a type
  ../node_modules/nan/nan_converters_43_inl.h:23: error: ‘return_t’ in class ‘Nan::imp::ToFactory&lt;v8::Uint32&gt;’ does not name a type
  ../node_modules/nan/nan_converters_43_inl.h:24: error: ‘return_t’ in class ‘Nan::imp::ToFactory&lt;v8::Int32&gt;’ does not name a type
  ../node_modules/nan/nan_converters_43_inl.h:34: error: ‘return_t’ in class ‘Nan::imp::ToFactory&lt;bool&gt;’ does not name a type
  ../node_modules/nan/nan_converters_43_inl.h:35: error: ‘return_t’ in class ‘Nan::imp::ToFactory&lt;double&gt;’ does not name a type
  ../node_modules/nan/nan_converters_43_inl.h:36: error: ‘return_t’ in class ‘Nan::imp::ToFactory&lt;long int&gt;’ does not name a type
  ../node_modules/nan/nan_converters_43_inl.h:37: error: ‘return_t’ in class ‘Nan::imp::ToFactory&lt;unsigned int&gt;’ does not name a type
  ../node_modules/nan/nan_converters_43_inl.h:38: error: ‘return_t’ in class ‘Nan::imp::ToFactory&lt;int&gt;’ 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&lt;T&gt; Nan::imp::To(v8::Local&lt;v8::Integer&gt;) [with T = v8::Integer]’:
  ../node_modules/nan/nan_new.h:21: error: no matching function for call to ‘To(v8::Local&lt;v8::Integer&gt;&amp;)’
  ../node_modules/nan/nan_new.h: In function ‘v8::Local&lt;T&gt; Nan::imp::To(v8::Local&lt;v8::Integer&gt;) [with T = v8::Int32]’:
  ../node_modules/nan/nan_new.h:28: error: no matching function for call to ‘To(v8::Local&lt;v8::Integer&gt;&amp;)’
  ../node_modules/nan/nan_new.h: In function ‘v8::Local&lt;T&gt; Nan::imp::To(v8::Local&lt;v8::Integer&gt;) [with T = v8::Uint32]’:
  ../node_modules/nan/nan_new.h:35: error: no matching function for call to ‘To(v8::Local&lt;v8::Integer&gt;&amp;)’
  ../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 ‘&lt;’ 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&lt;v8::Date&gt;’ does not name a type
  ../node_modules/nan/nan_implementation_12_inl.h: In static member function ‘static v8::Local&lt;v8::Function&gt; Nan::imp::Factory&lt;v8::Function&gt;::New(void (*)(const Nan::FunctionCallbackInfo&lt;v8::Value&gt;&amp;), v8::Local&lt;v8::Value&gt;)’:
  ../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&lt;v8::FunctionTemplate&gt; Nan::imp::Factory&lt;v8::FunctionTemplate&gt;::New(void (*)(const Nan::FunctionCallbackInfo&lt;v8::Value&gt;&amp;), v8::Local&lt;v8::Value&gt;, v8::Local&lt;v8::Signature&gt;)’:
  ../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&lt;v8::RegExp&gt;’ 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&lt;v8::String&gt;’ does not name a type
  ../node_modules/nan/nan_implementation_12_inl.h:281: error: ‘return_t’ in class ‘Nan::imp::Factory&lt;v8::String&gt;’ does not name a type
  ../node_modules/nan/nan_implementation_12_inl.h:286: error: ‘return_t’ in class ‘Nan::imp::Factory&lt;v8::String&gt;’ does not name a type
  ../node_modules/nan/nan_implementation_12_inl.h:347: error: ‘return_t’ in class ‘Nan::imp::Factory&lt;v8::UnboundScript&gt;’ does not name a type
  ../node_modules/nan/nan_implementation_12_inl.h:354: error: ‘return_t’ in class ‘Nan::imp::Factory&lt;v8::UnboundScript&gt;’ 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&lt;v8::String&gt;’ 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&lt;v8::RegExp&gt;’ 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&lt;v8::Value&gt; Nan::Error(const char*)’:
  ../node_modules/nan/nan.h:661: error: ‘class v8::Local&lt;v8::Boolean&gt;’ 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&lt;v8::Boolean&gt;’ has no member named ‘ToLocalChecked’
  ../node_modules/nan/nan.h: In function ‘v8::Local&lt;v8::Value&gt; Nan::RangeError(const char*)’:
  ../node_modules/nan/nan.h:662: error: ‘class v8::Local&lt;v8::Boolean&gt;’ 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&lt;v8::Boolean&gt;’ has no member named ‘ToLocalChecked’
  ../node_modules/nan/nan.h: In function ‘v8::Local&lt;v8::Value&gt; Nan::ReferenceError(const char*)’:
  ../node_modules/nan/nan.h:663: error: ‘class v8::Local&lt;v8::Boolean&gt;’ 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&lt;v8::Boolean&gt;’ has no member named ‘ToLocalChecked’
  ../node_modules/nan/nan.h: In function ‘v8::Local&lt;v8::Value&gt; Nan::SyntaxError(const char*)’:
  ../node_modules/nan/nan.h:664: error: ‘class v8::Local&lt;v8::Boolean&gt;’ 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&lt;v8::Boolean&gt;’ has no member named ‘ToLocalChecked’
  ../node_modules/nan/nan.h: In function ‘v8::Local&lt;v8::Value&gt; Nan::TypeError(const char*)’:
  ../node_modules/nan/nan.h:665: error: ‘class v8::Local&lt;v8::Boolean&gt;’ 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&lt;v8::Boolean&gt;’ has no member named ‘ToLocalChecked’
  ../node_modules/nan/nan.h: At global scope:
  ../node_modules/nan/nan.h:673: error: expected initializer before ‘&lt;’ token
  ../node_modules/nan/nan.h:695: error: expected initializer before ‘&lt;’ token
  ../node_modules/nan/nan.h:762: error: expected initializer before ‘&lt;’ token
  ../node_modules/nan/nan.h:768: error: expected initializer before ‘&lt;’ token
  /home/vagrant/.node-gyp/4.4.6/include/node/v8.h: In member function ‘void Nan::Callback::SetFunction(const v8::Local&lt;v8::Function&gt;&amp;)’:
  /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&lt;v8::Value&gt;&amp;)’:
  ../node_modules/nan/nan.h:1524: error: ‘class v8::Local&lt;v8::Boolean&gt;’ has no member named ‘ToLocalChecked’
  ../node_modules/nan/nan.h: In member function ‘v8::Local&lt;v8::Value&gt; Nan::AsyncWorker::GetFromPersistent(const char*) const’:
  ../node_modules/nan/nan.h:1542: error: ‘class v8::Local&lt;v8::Boolean&gt;’ 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&lt;v8::Object&gt;, const char*, void (*)(const Nan::FunctionCallbackInfo&lt;v8::Value&gt;&amp;))’:
  ../node_modules/nan/nan.h:1896: error: ‘GetFunction’ was not declared in this scope
  ../node_modules/nan/nan.h:1897: error: ‘class v8::Local&lt;v8::Boolean&gt;’ has no member named ‘ToLocalChecked’
  ../node_modules/nan/nan.h: In function ‘void Nan::SetMethod(v8::Local&lt;v8::FunctionTemplate&gt;, const char*, void (*)(const Nan::FunctionCallbackInfo&lt;v8::Value&gt;&amp;))’:
  ../node_modules/nan/nan.h:1908: error: ‘class v8::Local&lt;v8::Boolean&gt;’ has no member named ‘ToLocalChecked’
  ../node_modules/nan/nan.h: In function ‘void Nan::SetMethod(v8::Local&lt;v8::ObjectTemplate&gt;, const char*, void (*)(const Nan::FunctionCallbackInfo&lt;v8::Value&gt;&amp;))’:
  ../node_modules/nan/nan.h:1919: error: ‘class v8::Local&lt;v8::Boolean&gt;’ has no member named ‘ToLocalChecked’
  ../node_modules/nan/nan.h: In function ‘void Nan::SetPrototypeMethod(v8::Local&lt;v8::FunctionTemplate&gt;, const char*, void (*)(const Nan::FunctionCallbackInfo&lt;v8::Value&gt;&amp;))’:
  ../node_modules/nan/nan.h:1933: error: ‘class v8::Local&lt;v8::Boolean&gt;’ has no member named ‘ToLocalChecked’
  ../node_modules/nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local&lt;v8::ObjectTemplate&gt;, v8::Local&lt;v8::String&gt;, void (*)(v8::Local&lt;v8::String&gt;, const Nan::PropertyCallbackInfo&lt;v8::Value&gt;&amp;), void (*)(v8::Local&lt;v8::String&gt;, v8::Local&lt;v8::Value&gt;, const Nan::PropertyCallbackInfo&lt;void&gt;&amp;), v8::Local&lt;v8::Value&gt;, 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&lt;v8::Object&gt;, v8::Local&lt;v8::String&gt;, void (*)(v8::Local&lt;v8::String&gt;, const Nan::PropertyCallbackInfo&lt;v8::Value&gt;&amp;), void (*)(v8::Local&lt;v8::String&gt;, v8::Local&lt;v8::Value&gt;, const Nan::PropertyCallbackInfo&lt;void&gt;&amp;), v8::Local&lt;v8::Value&gt;, 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&lt;v8::ObjectTemplate&gt;, void (*)(v8::Local&lt;v8::String&gt;, const Nan::PropertyCallbackInfo&lt;v8::Value&gt;&amp;), void (*)(v8::Local&lt;v8::String&gt;, v8::Local&lt;v8::Value&gt;, const Nan::PropertyCallbackInfo&lt;v8::Value&gt;&amp;), void (*)(v8::Local&lt;v8::String&gt;, const Nan::PropertyCallbackInfo&lt;v8::Integer&gt;&amp;), void (*)(v8::Local&lt;v8::String&gt;, const Nan::PropertyCallbackInfo&lt;v8::Boolean&gt;&amp;), void (*)(const Nan::PropertyCallbackInfo&lt;v8::Array&gt;&amp;), v8::Local&lt;v8::Value&gt;)’:
  ../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&lt;v8::ObjectTemplate&gt;, void (*)(uint32_t, const Nan::PropertyCallbackInfo&lt;v8::Value&gt;&amp;), void (*)(uint32_t, v8::Local&lt;v8::Value&gt;, const Nan::PropertyCallbackInfo&lt;v8::Value&gt;&amp;), void (*)(uint32_t, const Nan::PropertyCallbackInfo&lt;v8::Integer&gt;&amp;), void (*)(uint32_t, const Nan::PropertyCallbackInfo&lt;v8::Boolean&gt;&amp;), void (*)(const Nan::PropertyCallbackInfo&lt;v8::Array&gt;&amp;), v8::Local&lt;v8::Value&gt;)’:
  ../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&lt;v8::FunctionTemplate&gt;, void (*)(const Nan::FunctionCallbackInfo&lt;v8::Value&gt;&amp;), v8::Local&lt;v8::Value&gt;)’:
  ../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&lt;v8::ObjectTemplate&gt;, void (*)(const Nan::FunctionCallbackInfo&lt;v8::Value&gt;&amp;), v8::Local&lt;v8::Value&gt;)’:
  ../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&lt;v8::Value&gt;&amp;))’:
  ../node_modules/nan/nan.h:2223: error: no matching function for call to ‘New(const char*&amp;)’
  ../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&lt;v8::Value&gt;)’:
  ../node_modules/nan/nan.h:2231: error: no matching function for call to ‘To(v8::Local&lt;v8::Value&gt;&amp;)’
  ../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
  
  &gt; 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
  &gt; (node-gyp rebuild 2&gt; 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'
  
  &gt; 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
  &gt; (node-gyp rebuild 2&gt; 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)
  </code></pre>
  
  <p>Tried upgrading/install of <strong>gcc</strong> using (yum), it says:</p>
  
  <pre><code>Package gcc-4.4.7-17.el6.x86_64 already installed and latest version
  </code></pre>
  
  <p>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 <a href="http://people.centos.org/tru/" rel="nofollow noreferrer">CentOS site</a>. devtoolset-2 has KNOWN issues as per the post: <a href="https://superuser.com/questions/381160/how-to-install-gcc-4-7-x-4-8-x-on-centos">https://superuser.com/questions/381160/how-to-install-gcc-4-7-x-4-8-x-on-centos</a></p>