我正在尝试在CentOS 7上构建keeweb,但在编译过程中似乎出现了一些NodeJS错误:
[root@localhost keeweb]# npm install
npm WARN npm npm does not support Node.js v10.2.1
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
> iltorb@https://registry.npmjs.org/iltorb/-/iltorb-1.0.13.tgz install /home/bilyes/Desktop/keeweb/node_modules/iltorb
> node-gyp rebuild
make: Entering directory `/home/bilyes/Desktop/keeweb/node_modules/iltorb/build'
CC(target) Release/obj.target/decode/brotli/common/dictionary.o
CC(target) Release/obj.target/decode/brotli/dec/bit_reader.o
CC(target) Release/obj.target/decode/brotli/dec/decode.o
CC(target) Release/obj.target/decode/brotli/dec/huffman.o
CC(target) Release/obj.target/decode/brotli/dec/state.o
CXX(target) Release/obj.target/decode/src/common/allocator.o
In file included from ../../nan/nan.h:190:0,
from ../src/common/allocator.cc:2:
../../nan/nan_maybe_43_inl.h: In function ‘Nan::Maybe<bool> Nan::ForceSet(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Value>, v8::PropertyAttribute)’:
../../nan/nan_maybe_43_inl.h:112:15: error: ‘class v8::Object’ has no member named ‘ForceSet’
return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs);
^
In file included from ../src/common/allocator.cc:2:0:
../../nan/nan.h: In function ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)’:
../../nan/nan.h:833:60: warning: ‘v8::Local<v8::Value> node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)’ is deprecated (declared at /root/.node-gyp/10.2.1/include/node/node.h:171): Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
v8::Isolate::GetCurrent(), target, func, argc, argv);
^
../../nan/nan.h: In function ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, v8::Local<v8::String>, int, v8::Local<v8::Value>*)’:
../../nan/nan.h:848:62: warning: ‘v8::Local<v8::Value> node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::String>, int, v8::Local<v8::Value>*)’ is deprecated (declared at /root/.node-gyp/10.2.1/include/node/node.h:164): Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
v8::Isolate::GetCurrent(), target, symbol, argc, argv);
^
../../nan/nan.h: In function ‘v8::Local<v8::Value> Nan::MakeCallback(v8::Local<v8::Object>, const char*, int, v8::Local<v8::Value>*)’:
../../nan/nan.h:863:62: warning: ‘v8::Local<v8::Value> node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, const char*, int, v8::Local<v8::Value>*)’ is deprecated (declared at /root/.node-gyp/10.2.1/include/node/node.h:157): Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
v8::Isolate::GetCurrent(), target, method, argc, argv);
^
../../nan/nan.h: In member function ‘v8::Local<v8::Value> Nan::Callback::Call_(v8::Isolate*, v8::Local<v8::Object>, int, v8::Local<v8::Value>*) const’:
../../nan/nan.h:1477:5: warning: ‘v8::Local<v8::Value> node::MakeCallback(v8::Isolate*, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*)’ is deprecated (declared at /root/.node-gyp/10.2.1/include/node/node.h:171): Use MakeCallback(..., async_context) [-Wdeprecated-declarations]
));
^
make: *** [Release/obj.target/decode/src/common/allocator.o] Error 1
make: Leaving directory `/home/bilyes/Desktop/keeweb/node_modules/iltorb/build'
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:258:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Linux 3.10.0-693.el7.x86_64
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 /home/bilyes/Desktop/keeweb/node_modules/iltorb
gyp ERR! node -v v10.2.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
> keytar@4.0.3 install /home/bilyes/Desktop/keeweb/node_modules/keytar
> node-gyp rebuild
make: Entering directory `/home/bilyes/Desktop/keeweb/node_modules/keytar/build'
CXX(target) Release/obj.target/keytar/src/async.o
In file included from ../../nan/nan.h:190:0,
from ../src/async.cc:3:
../../nan/nan_maybe_43_inl.h: In function ‘Nan::Maybe<bool> Nan::ForceSet(v8::Local<v8::Object>, v8::Local<v8::Value>, v8::Local<v8::Value>, v8::PropertyAttribute)’:
../../nan/nan_maybe_43_inl.h:112:15: error: ‘class v8::Object’ has no member named ‘ForceSet’
return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs);
^
make: *** [Release/obj.target/keytar/src/async.o] Error 1
make: Leaving directory `/home/bilyes/Desktop/keeweb/node_modules/keytar/build'
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:258:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Linux 3.10.0-693.el7.x86_64
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 /home/bilyes/Desktop/keeweb/node_modules/keytar
gyp ERR! node -v v10.2.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN lifecycle keeweb@1.6.3~postinstall: cannot run in wd %s %s (wd=%s) keeweb@1.6.3 cd desktop && npm install /home/bilyes/Desktop/keeweb
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: grunt-appdmg@0.4.0 (node_modules/grunt-appdmg):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for grunt-appdmg@0.4.0: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: appdmg@0.4.5 (node_modules/appdmg):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for appdmg@0.4.5: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: iltorb@1.0.13 (node_modules/iltorb):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: iltorb@https://registry.npmjs.org/iltorb/-/iltorb-1.0.13.tgz install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: keytar@4.0.3 (node_modules/keytar):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: keytar@4.0.3 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
moved 1 package in 40.458s
[root@localhost keeweb]#
这些是node
和npm
的版本:
[bilyes@localhost keeweb]$ node -v
v10.2.1
[bilyes@localhost keeweb]$ npm -v
5.6.0
答案 0 :(得分:0)
就我从前几行看到的那样,你应该首先尝试使用npm i -g npm
将你的npm升级到6.x
如果这不起作用,请检查开发的节点版本项目。尝试降级您的节点。
----编辑----
查看无法构建的模块。它取决于几个原生Linux库
https://github.com/atom/node-keytar
尝试安装所有必需的deps并重新构建
答案 1 :(得分:0)
降级到npm 5.6.1
修复了建筑问题,现在编译得很好。