make: Entering directory '/home/lyman/open-ip-kvm/node_modules/@serialport/bindings-cpp/build'
CXX(target) Release/obj.target/bindings/src/serialport.o
CXX(target) Release/obj.target/bindings/src/serialport_unix.o
CXX(target) Release/obj.target/bindings/src/poller.o
../src/poller.cpp: In static member function ‘static Napi::Object Poller::Init(Napi::Env, Napi::Object)’:
../src/poller.cpp:108:7: error: ‘class Napi::Env’ has no member named ‘SetInstanceData’
108 | env.SetInstanceData(constructor);
| ^~~~~~~
../src/poller.cpp:108:46: error: expected primary-expression before ‘>’ token
108 | env.SetInstanceData(constructor);
| ^
../src/poller.cpp: In static member function ‘static Napi::Value Poller::New(const Napi::CallbackInfo&)’:
../src/poller.cpp:127:53: error: ‘class Napi::Env’ has no member named ‘GetInstanceData’
127 | Napi::FunctionReference constructor = info.Env().GetInstanceData();
| ^~~~~~~
../src/poller.cpp:127:92: error: expected primary-expression before ‘>’ token
127 | Napi::FunctionReference constructor = info.Env().GetInstanceData();
| ^
../src/poller.cpp:127:94: error: expected primary-expression before ‘)’ token
127 | Napi::FunctionReference* constructor = info.Env().GetInstanceData();
| ^
make: * [bindings.target.mk:106: Release/obj.target/bindings/src/poller.o] Error 1
make: Leaving directory '/home/lyman/open-ip-kvm/node_modules/@serialport/bindings-cpp/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/share/nodejs/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 5.4.0-132-generic
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/lyman/open-ip-kvm/node_modules/@serialport/bindings-cpp
gyp ERR! node -v v10.19.0
gyp ERR! node-gyp -v v6.1.0
gyp ERR! not ok
npm WARN open-ip-kvm@1.0.0 No repository field.**
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @serialport/bindings-cpp@10.7.0 install: node-gyp-build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @serialport/bindings-cpp@10.7.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/lyman/.npm/_logs/2022-11-30T09_57_37_198Z-debug.log
lyman@openvpn:~/open-ip-kvm$
ubuntu系统上npm install 时候提示如下错误是什么问题。[找到原因了, 换了nodejs 14.17.0的版本就没问题了] lyman@openvpn:~/open-ip-kvm$ npm install
make: Entering directory '/home/lyman/open-ip-kvm/node_modules/@serialport/bindings-cpp/build' CXX(target) Release/obj.target/bindings/src/serialport.o CXX(target) Release/obj.target/bindings/src/serialport_unix.o CXX(target) Release/obj.target/bindings/src/poller.o ../src/poller.cpp: In static member function ‘static Napi::Object Poller::Init(Napi::Env, Napi::Object)’: ../src/poller.cpp:108:7: error: ‘class Napi::Env’ has no member named ‘SetInstanceData’ 108 | env.SetInstanceData(constructor);
| ^(constructor);
| ^
../src/poller.cpp: In static member function ‘static Napi::Value Poller::New(const Napi::CallbackInfo&)’:
../src/poller.cpp:127:53: error: ‘class Napi::Env’ has no member named ‘GetInstanceData’
127 | Napi::FunctionReference constructor = info.Env().GetInstanceData();
| ^ constructor = info.Env().GetInstanceData();
| ^
../src/poller.cpp:127:94: error: expected primary-expression before ‘)’ token
127 | Napi::FunctionReference* constructor = info.Env().GetInstanceData();
| ^
make: * [bindings.target.mk:106: Release/obj.target/bindings/src/poller.o] Error 1
make: Leaving directory '/home/lyman/open-ip-kvm/node_modules/@serialport/bindings-cpp/build'
gyp ERR! build error
gyp ERR! stack Error:
~~~~~~ ../src/poller.cpp:108:46: error: expected primary-expression before ‘>’ token 108 | env.SetInstanceData~~~~~~ ../src/poller.cpp:127:92: error: expected primary-expression before ‘>’ token 127 | Napi::FunctionReferencemake
failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/share/nodejs/node-gyp/lib/build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:198:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12) gyp ERR! System Linux 5.4.0-132-generic gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "rebuild" gyp ERR! cwd /home/lyman/open-ip-kvm/node_modules/@serialport/bindings-cpp gyp ERR! node -v v10.19.0 gyp ERR! node-gyp -v v6.1.0 gyp ERR! not ok npm WARN open-ip-kvm@1.0.0 No repository field.**npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @serialport/bindings-cpp@10.7.0 install:
node-gyp-build
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @serialport/bindings-cpp@10.7.0 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.npm ERR! A complete log of this run can be found in: npm ERR! /home/lyman/.npm/_logs/2022-11-30T09_57_37_198Z-debug.log lyman@openvpn:~/open-ip-kvm$