silverdagger
silverdagger

Reputation: 1172

Can't build contextify on ubuntu with node 8

This issue has been referenced in bug reports, however this doesn't seem resolved. There are several packages that require contextify which seems to not build on Ubuntu and Node 8.x

On npm install various packages, I get the following error:

make: Entering directory '/src/node_modules/contextify/build'
  CXX(target) Release/obj.target/contextify/src/contextify.o
../src/contextify.cc: In static member function 'static v8::Local<v8::Context> ContextWrap::createV8Context(v8::Local<v8::Object>)':
../src/contextify.cc:131:68: warning: 'v8::Local<v8::Object> v8::Function::NewInstance() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
         Local<Object> wrapper = Nan::New(constructor)->NewInstance();
                                                                    ^
In file included from /root/.node-gyp/8.10.0/include/node/v8.h:26:0,
                 from /root/.node-gyp/8.10.0/include/node/node.h:63,
                 from ../src/contextify.cc:1:
/root/.node-gyp/8.10.0/include/node/v8.h:3851:52: note: declared here
   V8_DEPRECATED("Use maybe version", Local<Object> NewInstance() const);
                                                    ^
/root/.node-gyp/8.10.0/include/node/v8config.h:318:3: note: in definition of macro 'V8_DEPRECATED'
   declarator __attribute__((deprecated(message)))
   ^
../src/contextify.cc:150:16: error: 'class v8::ObjectTemplate' has no member named 'SetAccessCheckCallbacks'
         otmpl->SetAccessCheckCallbacks(GlobalPropertyNamedAccessCheck,

Environment is:

Ubuntu Xenial 16.04
Node v8.10.0

Upvotes: 2

Views: 553

Answers (1)

user2932688
user2932688

Reputation: 1704

Had the same error on node 9.11.1 on mac the only way i was able to deal with it is following:

  1. install NVM

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.9/install.sh | bash

do not forget to add following to .bash_profile

[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh  # This loads NVM
export NVM_DIR="$HOME/.nvm"
  . "/usr/local/opt/nvm/nvm.sh"
  1. then nvm install v6.9.5 and also if you need latest nvm install node
  2. then nvm use v6.9.5, double check by node --version
  3. npm install in your folder

Upvotes: 2

Related Questions