此问题已在bug reports中引用,但这似乎无法解决。有几个需要contextify
的软件包似乎不构建在Ubuntu和Node 8.x
在npm install
各种软件包上,我收到以下错误:
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,
环境是:
Ubuntu Xenial 16.04
Node v8.10.0
答案 0 :(得分:2)
在mac上的节点9.11.1上有相同的错误 我能够处理它的唯一方法是:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.9/install.sh | bash
不要忘记将以下内容添加到.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"
nvm install v6.9.5
,如果您需要最新的nvm install node
nvm use v6.9.5
,按节点双重检查--version npm install