我试图在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
发布于 2018-06-05 04:27:02
降级到npm 5.6.1
解决了构建问题,现在它编译得很好。
发布于 2018-05-30 08:21:41
从前几行我可以看到,您应该首先尝试使用npm i -g npm
将npm升级到6.x。
如果这样做不起作用,请检查节点版本项目是在什么时候开发的。试着降低节点的级别。
编辑--编辑--
查看无法构建的模块。它依赖于两个本地Linux库。
https://github.com/atom/node-keytar
尝试安装所有所需的dep并重新构建。
https://stackoverflow.com/questions/50605548
复制