Closed CassianoSF closed 4 years ago
had exactly the same error. you need to use nodejs v8 to compile it.
@ccarnivore not really, this happens on a RPI:
npm WARN prepare removing existing node_modules/ before installation
> ftdi@1.2.1 install /home/pi/web/node_modules/ftdi
> node-gyp rebuild
make: Entering directory '/home/pi/web/node_modules/ftdi/build'
CXX(target) Release/obj.target/ftdi/src/ftdi_device.o
../src/ftdi_device.cc: In member function 'virtual void ReadWorker::HandleOKCallback()':
../src/ftdi_device.cc:190:85: warning: 'v8::Local<v8::Object> v8::Function::NewInstance(int, v8::Local<v8::Value>*) const' is deprecated: Use maybe version [-Wdeprecated-declarations]
Local<Object> actualBuffer = bufferConstructor->NewInstance(3, constructorArgs);
^
In file included from /home/pi/.cache/node-gyp/8.11.1/include/node/v8.h:26:0,
from /home/pi/.cache/node-gyp/8.11.1/include/node/node.h:63,
from /home/pi/.cache/node-gyp/8.11.1/include/node/node_buffer.h:25,
from ../src/ftdi_device.cc:8:
/home/pi/.cache/node-gyp/8.11.1/include/node/v8.h:3847:31: note: declared here
Local<Object> NewInstance(int argc, Local<Value> argv[]) const);
^
/home/pi/.cache/node-gyp/8.11.1/include/node/v8config.h:318:3: note: in definition of macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^~~~~~~~~~
../src/ftdi_device.cc:202:29: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
callback->Call(2, argv);
^
In file included from ../src/ftdi_device.h:9:0,
from ../src/ftdi_device.cc:11:
../../nan/nan.h:1674:3: note: declared here
Call(int argc, v8::Local<v8::Value> argv[]) const {
^~~~
../src/ftdi_device.cc: In member function 'virtual void OpenWorker::HandleOKCallback()':
../src/ftdi_device.cc:341:29: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
callback->Call(1, argv);
^
In file included from ../src/ftdi_device.h:9:0,
from ../src/ftdi_device.cc:11:
../../nan/nan.h:1674:3: note: declared here
Call(int argc, v8::Local<v8::Value> argv[]) const {
^~~~
../src/ftdi_device.cc: In static member function 'static Nan::NAN_METHOD_RETURN_TYPE ftdi_device::FtdiDevice::Open(Nan::NAN_METHOD_ARGS_TYPE)':
../src/ftdi_device.cc:395:27: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
callback->Call(1, argv);
^
In file included from ../src/ftdi_device.h:9:0,
from ../src/ftdi_device.cc:11:
../../nan/nan.h:1674:3: note: declared here
Call(int argc, v8::Local<v8::Value> argv[]) const {
^~~~
../src/ftdi_device.cc: In member function 'virtual void WriteWorker::HandleOKCallback()':
../src/ftdi_device.cc:549:29: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
callback->Call(1, argv);
^
In file included from ../src/ftdi_device.h:9:0,
from ../src/ftdi_device.cc:11:
../../nan/nan.h:1674:3: note: declared here
Call(int argc, v8::Local<v8::Value> argv[]) const {
^~~~
../src/ftdi_device.cc: In member function 'virtual void CloseWorker::HandleOKCallback()':
../src/ftdi_device.cc:648:29: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
callback->Call(1, argv);
^
In file included from ../src/ftdi_device.h:9:0,
from ../src/ftdi_device.cc:11:
../../nan/nan.h:1674:3: note: declared here
Call(int argc, v8::Local<v8::Value> argv[]) const {
^~~~
../src/ftdi_device.cc: In static member function 'static Nan::NAN_METHOD_RETURN_TYPE ftdi_device::FtdiDevice::Close(Nan::NAN_METHOD_ARGS_TYPE)':
../src/ftdi_device.cc:678:29: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
callback->Call(1, argv);
^
In file included from ../src/ftdi_device.h:9:0,
from ../src/ftdi_device.cc:11:
../../nan/nan.h:1674:3: note: declared here
Call(int argc, v8::Local<v8::Value> argv[]) const {
^~~~
../src/ftdi_device.cc: In member function 'void ftdi_device::FtdiDevice::ExtractDeviceSettings(v8::Local<v8::Object>)':
../src/ftdi_device.cc:770:61: warning: 'v8::Local<v8::Int32> v8::Value::ToInt32() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
deviceParams.baudRate = options->Get(baudrate)->ToInt32()->Int32Value();
^
In file included from /home/pi/.cache/node-gyp/8.11.1/include/node/node.h:63:0,
from /home/pi/.cache/node-gyp/8.11.1/include/node/node_buffer.h:25,
from ../src/ftdi_device.cc:8:
/home/pi/.cache/node-gyp/8.11.1/include/node/v8.h:9796:14: note: declared here
Local<Int32> Value::ToInt32() const {
^~~~~
../src/ftdi_device.cc:774:77: warning: 'v8::Local<v8::Int32> v8::Value::ToInt32() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
deviceParams.wordLength = GetWordLength(options->Get(databits)->ToInt32()->Int32Value());
^
In file included from /home/pi/.cache/node-gyp/8.11.1/include/node/node.h:63:0,
from /home/pi/.cache/node-gyp/8.11.1/include/node/node_buffer.h:25,
from ../src/ftdi_device.cc:8:
/home/pi/.cache/node-gyp/8.11.1/include/node/v8.h:9796:14: note: declared here
Local<Int32> Value::ToInt32() const {
^~~~~
../src/ftdi_device.cc:778:73: warning: 'v8::Local<v8::Int32> v8::Value::ToInt32() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
deviceParams.stopBits = GetStopBits(options->Get(stopbits)->ToInt32()->Int32Value());
^
In file included from /home/pi/.cache/node-gyp/8.11.1/include/node/node.h:63:0,
from /home/pi/.cache/node-gyp/8.11.1/include/node/node_buffer.h:25,
from ../src/ftdi_device.cc:8:
/home/pi/.cache/node-gyp/8.11.1/include/node/v8.h:9796:14: note: declared here
Local<Int32> Value::ToInt32() const {
^~~~~
../src/ftdi_device.cc:793:61: warning: 'v8::Local<v8::Int32> v8::Value::ToInt32() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
deviceParams.bitMode = options->Get(bitmode)->ToInt32()->Int32Value();
^
In file included from /home/pi/.cache/node-gyp/8.11.1/include/node/node.h:63:0,
from /home/pi/.cache/node-gyp/8.11.1/include/node/node_buffer.h:25,
from ../src/ftdi_device.cc:8:
/home/pi/.cache/node-gyp/8.11.1/include/node/v8.h:9796:14: note: declared here
Local<Int32> Value::ToInt32() const {
^~~~~
../src/ftdi_device.cc:801:61: warning: 'v8::Local<v8::Int32> v8::Value::ToInt32() const' is deprecated: Use maybe version [-Wdeprecated-declarations]
deviceParams.bitMask = options->Get(bitmask)->ToInt32()->Int32Value();
^
In file included from /home/pi/.cache/node-gyp/8.11.1/include/node/node.h:63:0,
from /home/pi/.cache/node-gyp/8.11.1/include/node/node_buffer.h:25,
from ../src/ftdi_device.cc:8:
/home/pi/.cache/node-gyp/8.11.1/include/node/v8.h:9796:14: note: declared here
Local<Int32> Value::ToInt32() const {
^~~~~
CXX(target) Release/obj.target/ftdi/src/ftdi_driver.o
../src/ftdi_driver.cc: In member function 'virtual void FindAllWorker::HandleOKCallback()':
../src/ftdi_driver.cc:187:27: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
callback->Call(2, argv);
^
In file included from ../src/ftdi_driver.h:8:0,
from ../src/ftdi_driver.cc:6:
../../nan/nan.h:1674:3: note: declared here
Call(int argc, v8::Local<v8::Value> argv[]) const {
^~~~
SOLINK_MODULE(target) Release/obj.target/ftdi.node
//usr/local/lib/libftd2xx.so: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
ftdi.target.mk:135: recipe for target 'Release/obj.target/ftdi.node' failed
make: *** [Release/obj.target/ftdi.node] Error 1
make: Leaving directory '/home/pi/web/node_modules/ftdi/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/opt/nodejs/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.14.98-v7+
gyp ERR! command "/usr/bin/node" "/opt/nodejs/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/web/node_modules/ftdi
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ftdi@1.2.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ftdi@1.2.1 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/pi/.npm/_logs/2020-02-14T14_20_40_796Z-debug.log
@HMAZonderland this issue was created for an ubuntu 18 platform. your error looks like you did'nt installed the FTDI library itself.
I cloned the repo and
sudo ./install.sh
it:than I
yarn add node-ftdi
into my fresh new project and that is what happen:Sorry if I did something silly.