FWIW, I stuck in the same spot. New raspbian stretch install (had sdcard corruption, so starting over), and I can't get serialport to install.
pi@gateway:/mnt/gateway $ sudo npm install --unsafe-perm --build-from-source
(node:26209) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
> RaspberryPi-Gateway@8.10.0 preinstall /mnt/gateway
>
npm WARN deprecated nodemailer@1.10.0: All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/
npm WARN deprecated mailcomposer@2.1.0: This project is unmaintained
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
npm WARN deprecated buildmail@2.0.0: This project is unmaintained
npm WARN package.json node-pre-gyp@0.6.18 license should be a valid SPDX license expression
|
> serialport@2.0.6 install /mnt/gateway/node_modules/serialport
> node-pre-gyp install --fallback-to-build
make: Entering directory '/mnt/gateway/node_modules/serialport/build'
make: Warning: File 'serialport.target.mk' has modification time 1451 s in the future
CXX(target) Release/obj.target/serialport/src/serialport.o
In file included from ../node_modules/nan/nan.h:182:0,
from ../src/serialport.h:5,
from ../src/serialport.cpp:3:
../node_modules/nan/nan_maybe_43_inl.h: In function ‘Nan::MaybeLocal<v8::Object> Nan::CloneElementAt(v8::Local<v8::Array>, uint32_t)’:
../node_modules/nan/nan_maybe_43_inl.h:221:58: warning: ‘v8::MaybeLocal<v8::Object> v8::Array::CloneElementAt(v8::Local<v8::Context>, uint32_t)’ is deprecated: Cloning is not supported. [-Wdeprecated-declarations]
return array->CloneElementAt(GetCurrentContext(), index);
^
In file included from /usr/include/nodejs/deps/v8/include/v8.h:26:0,
from /usr/include/nodejs/src/node.h:63,
from ../node_modules/nan/nan.h:24,
from ../src/serialport.h:5,
from ../src/serialport.cpp:3:
/usr/include/nodejs/deps/v8/include/v8.h:3517:36: note: declared here
MaybeLocal<Object> CloneElementAt(Local<Context> context,
^
/usr/include/nodejs/deps/v8/include/v8config.h:318:3: note: in definition of macro ‘V8_DEPRECATED’
declarator __attribute__((deprecated(message)))
^~~~~~~~~~
In file included from ../node_modules/nan/nan_new.h:189:0,
from ../node_modules/nan/nan.h:188,
from ../src/serialport.h:5,
from ../src/serialport.cpp:3:
../node_modules/nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::BooleanObject>::return_t Nan::imp::Factory<v8::BooleanObject>::New(bool)’:
../node_modules/nan/nan_implementation_12_inl.h:40:38: warning: ‘static v8::Local<v8::Value> v8::BooleanObject::New(bool)’ is deprecated: Pass an isolate [-Wdeprecated-declarations]
return v8::BooleanObject::New(value).As<v8::BooleanObject>();
^
In file included from /usr/include/nodejs/deps/v8/include/v8.h:26:0,
from /usr/include/nodejs/src/node.h:63,
from ../node_modules/nan/nan.h:24,
from ../src/serialport.h:5,
from ../src/serialport.cpp:3:
/usr/include/nodejs/deps/v8/include/v8.h:4845:56: note: declared here
V8_DEPRECATED("Pass an isolate", static Local<Value> New(bool value));
^
/usr/include/nodejs/deps/v8/include/v8config.h:318:3: note: in definition of macro ‘V8_DEPRECATED’
declarator __attribute__((deprecated(message)))
^~~~~~~~~~
In file included from ../src/serialport.h:5:0,
from ../src/serialport.cpp:3:
../node_modules/nan/nan.h: At global scope:
../node_modules/nan/nan.h:590:20: error: variable or field ‘AddGCEpilogueCallback’ declared void
v8::Isolate::GCEpilogueCallback callback
^~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:590:7: error: ‘GCEpilogueCallback’ is not a member of ‘v8::Isolate’
v8::Isolate::GCEpilogueCallback callback
^~
../node_modules/nan/nan.h:591:18: error: expected primary-expression before ‘gc_type_filter’
, v8::GCType gc_type_filter = v8::kGCTypeAll) {
^~~~~~~~~~~~~~
../node_modules/nan/nan.h:596:20: error: variable or field ‘RemoveGCEpilogueCallback’ declared void
v8::Isolate::GCEpilogueCallback callback) {
^~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:596:7: error: ‘GCEpilogueCallback’ is not a member of ‘v8::Isolate’
v8::Isolate::GCEpilogueCallback callback) {
^~
../node_modules/nan/nan.h:601:20: error: variable or field ‘AddGCPrologueCallback’ declared void
v8::Isolate::GCPrologueCallback callback
^~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:601:7: error: ‘GCPrologueCallback’ is not a member of ‘v8::Isolate’
v8::Isolate::GCPrologueCallback callback
^~
../node_modules/nan/nan.h:602:18: error: expected primary-expression before ‘gc_type_filter’
, v8::GCType gc_type_filter = v8::kGCTypeAll) {
^~~~~~~~~~~~~~
../node_modules/nan/nan.h:607:20: error: variable or field ‘RemoveGCPrologueCallback’ declared void
v8::Isolate::GCPrologueCallback callback) {
^~~~~~~~~~~~~~~~~~
../node_modules/nan/nan.h:607:7: error: ‘GCPrologueCallback’ is not a member of ‘v8::Isolate’
v8::Isolate::GCPrologueCallback callback) {
^~
../node_modules/nan/nan.h: In function ‘bool Nan::SetAccessor(v8::Local<v8::Object>, v8::Local<v8::String>, Nan::GetterCallback, Nan::SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute)’:
../node_modules/nan/nan.h:1933:16: warning: ‘bool v8::Object::SetAccessor(v8::Local<v8::Name>, v8::AccessorNameGetterCallback, v8::AccessorNameSetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
, attribute);
^
In file included from /usr/include/nodejs/deps/v8/include/v8.h:26:0,
from /usr/include/nodejs/src/node.h:63,
from ../node_modules/nan/nan.h:24,
from ../src/serialport.h:5,
from ../src/serialport.cpp:3:
/usr/include/nodejs/deps/v8/include/v8.h:3187:22: note: declared here
bool SetAccessor(Local<Name> name,
^
/usr/include/nodejs/deps/v8/include/v8config.h:318:3: note: in definition of macro ‘V8_DEPRECATED’
declarator __attribute__((deprecated(message)))
^~~~~~~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Open(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:115:116: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
baton->baudRate = Nan::Get(options, Nan::New<v8::String>("baudRate").ToLocalChecked()).ToLocalChecked()->ToInt32()->Int32Value();
^
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../node_modules/nan/nan.h:24,
from ../src/serialport.h:5,
from ../src/serialport.cpp:3:
/usr/include/nodejs/deps/v8/include/v8.h:9796:14: note: declared here
Local<Int32> Value::ToInt32() const {
^~~~~
../src/serialport.cpp:116:116: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
baton->dataBits = Nan::Get(options, Nan::New<v8::String>("dataBits").ToLocalChecked()).ToLocalChecked()->ToInt32()->Int32Value();
^
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../node_modules/nan/nan.h:24,
from ../src/serialport.h:5,
from ../src/serialport.cpp:3:
/usr/include/nodejs/deps/v8/include/v8.h:9796:14: note: declared here
Local<Int32> Value::ToInt32() const {
^~~~~
../src/serialport.cpp:117:120: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
baton->bufferSize = Nan::Get(options, Nan::New<v8::String>("bufferSize").ToLocalChecked()).ToLocalChecked()->ToInt32()->Int32Value();
^
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../node_modules/nan/nan.h:24,
from ../src/serialport.h:5,
from ../src/serialport.cpp:3:
/usr/include/nodejs/deps/v8/include/v8.h:9796:14: note: declared here
Local<Int32> Value::ToInt32() const {
^~~~~
../src/serialport.cpp:119:131: warning: ‘v8::Local<v8::Number> v8::Value::ToNumber() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
baton->stopBits = ToStopBitEnum(Nan::Get(options, Nan::New<v8::String>("stopBits").ToLocalChecked()).ToLocalChecked()->ToNumber()->NumberValue());
^
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../node_modules/nan/nan.h:24,
from ../src/serialport.h:5,
from ../src/serialport.cpp:3:
/usr/include/nodejs/deps/v8/include/v8.h:9760:15: note: declared here
Local<Number> Value::ToNumber() const {
^~~~~
../src/serialport.cpp: In function ‘void EIO_AfterOpen(uv_work_t*)’:
../src/serialport.cpp:159:31: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
int fd = argv[1]->ToInt32()->Int32Value();
^
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../node_modules/nan/nan.h:24,
from ../src/serialport.h:5,
from ../src/serialport.cpp:3:
/usr/include/nodejs/deps/v8/include/v8.h:9796:14: note: declared here
Local<Int32> Value::ToInt32() const {
^~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Update(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:180:29: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
int fd = info[0]->ToInt32()->Int32Value();
^
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../node_modules/nan/nan.h:24,
from ../src/serialport.h:5,
from ../src/serialport.cpp:3:
/usr/include/nodejs/deps/v8/include/v8.h:9796:14: note: declared here
Local<Int32> Value::ToInt32() const {
^~~~~
../src/serialport.cpp:199:116: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
baton->baudRate = Nan::Get(options, Nan::New<v8::String>("baudRate").ToLocalChecked()).ToLocalChecked()->ToInt32()->Int32Value();
^
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../node_modules/nan/nan.h:24,
from ../src/serialport.h:5,
from ../src/serialport.cpp:3:
/usr/include/nodejs/deps/v8/include/v8.h:9796:14: note: declared here
Local<Int32> Value::ToInt32() const {
^~~~~
../src/serialport.cpp:200:116: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
baton->dataBits = Nan::Get(options, Nan::New<v8::String>("dataBits").ToLocalChecked()).ToLocalChecked()->ToInt32()->Int32Value();
^
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../node_modules/nan/nan.h:24,
from ../src/serialport.h:5,
from ../src/serialport.cpp:3:
/usr/include/nodejs/deps/v8/include/v8.h:9796:14: note: declared here
Local<Int32> Value::ToInt32() const {
^~~~~
../src/serialport.cpp:201:120: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
baton->bufferSize = Nan::Get(options, Nan::New<v8::String>("bufferSize").ToLocalChecked()).ToLocalChecked()->ToInt32()->Int32Value();
^
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../node_modules/nan/nan.h:24,
from ../src/serialport.h:5,
from ../src/serialport.cpp:3:
/usr/include/nodejs/deps/v8/include/v8.h:9796:14: note: declared here
Local<Int32> Value::ToInt32() const {
^~~~~
../src/serialport.cpp:203:131: warning: ‘v8::Local<v8::Number> v8::Value::ToNumber() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
baton->stopBits = ToStopBitEnum(Nan::Get(options, Nan::New<v8::String>("stopBits").ToLocalChecked()).ToLocalChecked()->ToNumber()->NumberValue());
^
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../node_modules/nan/nan.h:24,
from ../src/serialport.h:5,
from ../src/serialport.cpp:3:
/usr/include/nodejs/deps/v8/include/v8.h:9760:15: note: declared here
Local<Number> Value::ToNumber() const {
^~~~~
../src/serialport.cpp: In function ‘void EIO_AfterUpdate(uv_work_t*)’:
../src/serialport.cpp:242:31: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
int fd = argv[1]->ToInt32()->Int32Value();
^
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../node_modules/nan/nan.h:24,
from ../src/serialport.h:5,
from ../src/serialport.cpp:3:
/usr/include/nodejs/deps/v8/include/v8.h:9796:14: note: declared here
Local<Int32> Value::ToInt32() const {
^~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Write(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:263:29: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
int fd = info[0]->ToInt32()->Int32Value();
^
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../node_modules/nan/nan.h:24,
from ../src/serialport.h:5,
from ../src/serialport.cpp:3:
/usr/include/nodejs/deps/v8/include/v8.h:9796:14: note: declared here
Local<Int32> Value::ToInt32() const {
^~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Close(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:374:29: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
int fd = info[0]->ToInt32()->Int32Value();
^
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../node_modules/nan/nan.h:24,
from ../src/serialport.h:5,
from ../src/serialport.cpp:3:
/usr/include/nodejs/deps/v8/include/v8.h:9796:14: note: declared here
Local<Int32> Value::ToInt32() const {
^~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Flush(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:493:29: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
int fd = info[0]->ToInt32()->Int32Value();
^
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../node_modules/nan/nan.h:24,
from ../src/serialport.h:5,
from ../src/serialport.cpp:3:
/usr/include/nodejs/deps/v8/include/v8.h:9796:14: note: declared here
Local<Int32> Value::ToInt32() const {
^~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Set(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:542:29: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
int fd = info[0]->ToInt32()->Int32Value();
^
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../node_modules/nan/nan.h:24,
from ../src/serialport.h:5,
from ../src/serialport.cpp:3:
/usr/include/nodejs/deps/v8/include/v8.h:9796:14: note: declared here
Local<Int32> Value::ToInt32() const {
^~~~~
../src/serialport.cpp: In function ‘Nan::NAN_METHOD_RETURN_TYPE Drain(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/serialport.cpp:603:29: warning: ‘v8::Local<v8::Int32> v8::Value::ToInt32() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
int fd = info[0]->ToInt32()->Int32Value();
^
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../node_modules/nan/nan.h:24,
from ../src/serialport.h:5,
from ../src/serialport.cpp:3:
/usr/include/nodejs/deps/v8/include/v8.h:9796:14: note: declared here
Local<Int32> Value::ToInt32() const {
^~~~~
serialport.target.mk:95: recipe for target 'Release/obj.target/serialport/src/serialport.o' failed
make: *** [Release/obj.target/serialport/src/serialport.o] Error 1
make: Leaving directory '/mnt/gateway/node_modules/serialport/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:276: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.52-v7+
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "build" "--fallback-to-build" "--module=/mnt/gateway/node_modules/serialport/build/Release/node-v57-linux-arm/serialport.node" "--module_name=serialport" "--module_path=/mnt/gateway/node_modules/serialport/build/Release/node-v57-linux-arm"
gyp ERR! cwd /mnt/gateway/node_modules/serialport
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp build --fallback-to-build --module=/mnt/gateway/node_modules/serialport/build/Release/node-v57-linux-arm/serialport.node --module_name=serialport --module_path=/mnt/gateway/node_modules/serialport/build/Release/node-v57-linux-arm' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/mnt/gateway/node_modules/serialport/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:925:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Linux 4.14.52-v7+
node-pre-gyp ERR! command "/usr/bin/node" "/mnt/gateway/node_modules/serialport/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /mnt/gateway/node_modules/serialport
node-pre-gyp ERR! node -v v8.11.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.18
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp build --fallback-to-build --module=/mnt/gateway/node_modules/serialport/build/Release/node-v57-linux-arm/serialport.node --module_name=serialport --module_path=/mnt/gateway/node_modules/serialport/build/Release/node-v57-linux-arm' (1)
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR! serialport@2.0.6 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serialport@2.0.6 install script.
npm ERR! This is most likely a problem with the serialport package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get their info via:
npm ERR! npm owner ls serialport
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.14.52-v7+
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "--unsafe-perm" "--build-from-source"
npm ERR! cwd /mnt/gateway
npm ERR! node -v v8.11.1
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /mnt/gateway/npm-debug.log
npm ERR! not ok code 0
pi@gateway:/mnt/gateway $ npm -v
-bash: /usr/local/bin/npm: No such file or directory
pi@gateway:/mnt/gateway $ /usr/bin/npm -v
1.4.21
(node:26584) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
pi@gateway:/mnt/gateway $ nodejs -v
v8.11.1