Closed bobisaperson1 closed 1 year ago
You might be using an old version of nodejs. Install the latest version of node and npm. Your npm is ancient.
I'm getting the same error. Using nodejs v14.8.0 and npm 6.14.7
`➜ node_airtunes git:(fix_port_0_error) npm install
airtunes@0.1.7 install /home/pi/Projects/node_airtunes node-gyp rebuild
make: Entering directory '/home/pi/Projects/node_airtunes/build'
CXX(target) Release/obj.target/airtunes/src/codec.o
In file included from ../src/../alac/ALACEncoder.h:29,
from ../src/codec.cc:15:
../src/../alac/ALACAudioTypes.h:64:32: warning: multi-character character constant [-Wmultichar]
kALACFormatAppleLossless = 'alac',
^~
../src/../alac/ALACAudioTypes.h:65:28: warning: multi-character character constant [-Wmultichar]
kALACFormatLinearPCM = 'lpcm'
^~
../src/../alac/ALACAudioTypes.h:154:22: warning: multi-character character constant [-Wmultichar]
kALACCodecFormat = 'alac',
^~
../src/../alac/ALACAudioTypes.h:182:26: warning: multi-character character constant [-Wmultichar]
AudioChannelLayoutAID = 'chan'
^~
../src/codec.cc: In function ‘void nodeairtunes::NewEncoder(const v8::FunctionCallbackInfo~~
/home/pi/.cache/node-gyp/14.8.0/include/node/v8.h:6755:44: note: candidate expects 1 argument, 0 provided
../src/codec.cc: In function ‘void nodeairtunes::EncodeALAC(const v8::FunctionCallbackInfo~~~
/home/pi/.cache/node-gyp/14.8.0/include/node/v8.h:2822:44: note: candidate expects 1 argument, 0 provided
../src/codec.cc:95:77: error: no matching function for call to ‘v8::Value::ToObject()’
unsigned char pcmData = (unsigned char)Buffer::Data(pcmBuffer->ToObject());
^
In file included from /home/pi/.cache/node-gyp/14.8.0/include/node/node.h:67,
from ../src/codec.cc:1:
/home/pi/.cache/node-gyp/14.8.0/include/node/v8.h:2822:44: note: candidate: ‘v8::MaybeLocal~~~
/home/pi/.cache/node-gyp/14.8.0/include/node/v8.h:2822:44: note: candidate expects 1 argument, 0 provided
../src/codec.cc:98:79: error: no matching function for call to ‘v8::Value::ToObject()’
unsigned char alacData = (unsigned char)Buffer::Data(alacBuffer->ToObject());
^
In file included from /home/pi/.cache/node-gyp/14.8.0/include/node/node.h:67,
from ../src/codec.cc:1:
/home/pi/.cache/node-gyp/14.8.0/include/node/v8.h:2822:44: note: candidate: ‘v8::MaybeLocal~~~
/home/pi/.cache/node-gyp/14.8.0/include/node/v8.h:2822:44: note: candidate expects 1 argument, 0 provided
../src/codec.cc:100:41: error: no matching function for call to ‘v8::Value::Int32Value()’
int32_t pcmSize = args[3]->Int32Value();
^
In file included from /home/pi/.cache/node-gyp/14.8.0/include/node/node.h:67,
from ../src/codec.cc:1:
/home/pi/.cache/node-gyp/14.8.0/include/node/v8.h:2869:40: note: candidate: ‘v8::Maybe~~~~~
/home/pi/.cache/node-gyp/14.8.0/include/node/v8.h:2869:40: note: candidate expects 1 argument, 0 provided
../src/codec.cc: In function ‘void nodeairtunes::EncryptAES(const v8::FunctionCallbackInfo~~~
/home/pi/.cache/node-gyp/14.8.0/include/node/v8.h:2822:44: note: candidate expects 1 argument, 0 provided
../src/codec.cc:123:42: error: no matching function for call to ‘v8::Value::Int32Value()’
int32_t alacSize = args[1]->Int32Value();
^
In file included from /home/pi/.cache/node-gyp/14.8.0/include/node/node.h:67,
from ../src/codec.cc:1:
/home/pi/.cache/node-gyp/14.8.0/include/node/v8.h:2869:40: note: candidate: ‘v8::Maybe~~~~~
/home/pi/.cache/node-gyp/14.8.0/include/node/v8.h:2869:40: note: candidate expects 1 argument, 0 provided
../src/codec.cc: At global scope:
../src/codec.cc:149:16: error: variable or field ‘InitCodec’ declared void
void InitCodec(Handle~
../src/codec.cc:149:16: error: ‘Handle’ was not declared in this scope
../src/codec.cc:149:16: note: suggested alternative: ‘rand_r’
void InitCodec(Handle~
rand_r
../src/codec.cc:149:29: error: expected primary-expression before ‘>’ token
void InitCodec(Handle~
../src/codec.cc:149:31: note: suggested alternative: ‘tzset’
void InitCodec(Handle~
tzset
make: *** [airtunes.target.mk:117: Release/obj.target/airtunes/src/codec.o] Error 1
make: Leaving directory '/home/pi/Projects/node_airtunes/build'
gyp ERR! build error
gyp ERR! stack Error: make
failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:314:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Linux 5.4.51-v7l+
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/Projects/node_airtunes
gyp ERR! node -v v14.8.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! airtunes@0.1.7 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the airtunes@0.1.7 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-08-16T09_22_14_337Z-debug.log ➜ node_airtunes git:(fix_port_0_error) npm -v 6.14.7 ➜ node_airtunes git:(fix_port_0_error)`
I am getting the same error. Tried latest node version 15 (not using apt-get). Manually installed all the dependencies - struggling with node-gyp. I think the problem comes from node_airtunes and ALAC but this is where my knowledge goes :-(
same here
Same issue, looks like node-airtunes is incompatiable with newer version. node --version v16.13.0 npm --version 8.1.0
The install failed at this step:
pi@raspberrypi:~/babelpod $ sudo npm install (node:18541) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead. npm WARN package.json babelpod@0.0.1 No repository field. npm WARN package.json babelpod@0.0.1 No license field. \
make: Entering directory '/home/pi/babelpod/node_modules/airtunes/build' CXX(target) Release/obj.target/airtunes/src/codec.o In file included from ../src/../alac/ALACEncoder.h:29:0, from ../src/codec.cc:15: ../src/../alac/ALACAudioTypes.h:64:32: warning: multi-character character constant [-Wmultichar] kALACFormatAppleLossless = 'alac', ^, void)’:
../src/codec.cc:59:15: error: ‘v8::HandleScope::HandleScope()’ is protected within this context
HandleScope scope;
^~~~~
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../src/codec.cc:1:
/usr/include/nodejs/deps/v8/include/v8.h:875:13: note: declared protected here
V8_INLINE HandleScope() {}
^’ has no member named ‘Dispose’
wrapper.Dispose();
^ NewEncoder(const Arguments& args) {
^ nodeairtunes::NewEncoder(const int&)’:
../src/codec.cc:68:15: error: ‘v8::HandleScope::HandleScope()’ is protected within this context
HandleScope scope;
^~~~~
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../src/codec.cc:1:
/usr/include/nodejs/deps/v8/include/v8.h:875:13: note: declared protected here
V8_INLINE HandleScope() {}
^ v8::ObjectTemplate::New()’ is deprecated: Use isolate version [-Wdeprecated-declarations]
emplate> encoderClass = Persistent::New(ObjectTemplate::New());
^
In file included from /usr/include/nodejs/deps/v8/include/v8.h:26:0,
from /usr/include/nodejs/src/node.h:63,
from ../src/codec.cc:1:
/usr/include/nodejs/deps/v8/include/v8.h:5706:69: note: declared here
static V8_DEPRECATED("Use isolate version", Local New());
^
/usr/include/nodejs/deps/v8/include/v8config.h:318:3: note: in definition of macro ‘V8_DEPRECATED’
declarator attribute((deprecated(message)))
^::New(v8::Local)’
emplate> encoderClass = Persistent::New(ObjectTemplate::New());
^
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../src/codec.cc:1:
/usr/include/nodejs/deps/v8/include/v8.h:9167:4: note: candidate: static T v8::PersistentBase::New(v8::Isolate, T) [with T = v8::ObjectTemplate]
T PersistentBase::New(Isolate isolate, T that) {
^’
encoderClass->SetInternalFieldCount(1);
^~
../src/codec.cc:80:62: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent’
Persistent )’
return scope.Close(Null());
^
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../src/codec.cc:1:
/usr/include/nodejs/deps/v8/include/v8.h:314:27: note: declared here
friend Local Null(Isolate isolate);
^~~~
../src/codec.cc:95:32: error: invalid types ‘const int[int]’ for array subscript
Localwrapper = args[0]->ToObject();
^
../src/codec.cc:96:49: error: ‘class v8::Object’ has no member named ‘GetPointerFromInternalField’; did you mean ‘GetAlignedPointerFromInternalField’?
ALACEncoder encoder = (ALACEncoder)wrapper->GetPointerFromInternalField(0);
^ pcmBuffer = args[1];
^
../src/codec.cc:101:35: error: invalid types ‘const int[int]’ for array subscript
Local alacBuffer = args[2];
^
../src/codec.cc:104:27: error: invalid types ‘const int[int]’ for array subscript
int32_t pcmSize = args[3]->Int32Value();
^
../src/codec.cc:113:16: error: ‘class v8::HandleScope’ has no member named ‘Close’
return scope.Close(Integer::New(alacSize));
^~~~~
../src/codec.cc:113:43: error: no matching function for call to ‘v8::Integer::New(int32_t&)’
return scope.Close(Integer::New(alacSize));
^
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../src/codec.cc:1:
/usr/include/nodejs/deps/v8/include/v8.h:2929:25: note: candidate: static v8::Local v8::Integer::New(v8::Isolate , int32_t)
static Local New(Isolate isolate, int32_t value);
^~~
/usr/include/nodejs/deps/v8/include/v8.h:2929:25: note: candidate expects 2 arguments, 1 provided
../src/codec.cc: At global scope:
../src/codec.cc:116:32: error: ‘Arguments’ does not name a type
Handle EncryptAES(const Arguments& args) {
^ nodeairtunes::EncryptAES(const int&)’:
../src/codec.cc:117:15: error: ‘v8::HandleScope::HandleScope()’ is protected within this context
HandleScope scope;
^~~~~
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../src/codec.cc:1:
/usr/include/nodejs/deps/v8/include/v8.h:875:13: note: declared protected here
V8_INLINE HandleScope() {}
^ v8::Null(v8::Isolate )’
return scope.Close(Null());
^
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../src/codec.cc:1:
/usr/include/nodejs/deps/v8/include/v8.h:314:27: note: declared here
friend Local Null(Isolate isolate);
^~~~
../src/codec.cc:124:35: error: invalid types ‘const int[int]’ for array subscript
Local alacBuffer = args[0];
^
../src/codec.cc:126:28: error: invalid types ‘const int[int]’ for array subscript
int32_t alacSize = args[1]->Int32Value();
^
../src/codec.cc:149:16: error: ‘class v8::HandleScope’ has no member named ‘Close’
return scope.Close(Null());
^~~~~
../src/codec.cc:149:27: error: too few arguments to function ‘v8::Local v8::Null(v8::Isolate )’
return scope.Close(Null());
^
In file included from /usr/include/nodejs/src/node.h:63:0,
from ../src/codec.cc:1:
/usr/include/nodejs/deps/v8/include/v8.h:314:27: note: declared here
friend Local Null(Isolate isolate);
^~~~
../src/codec.cc: In function ‘void nodeairtunes::InitCodec(v8::Handle)’:
../src/codec.cc:153:51: error: invalid conversion from ‘v8::Handle ( )(const int&) {aka v8::Local ()(const int&)}’ to ‘v8::FunctionCallback {aka void ()(const v8::FunctionCallbackInfo&)}’ [-fpermissive]
NODE_SET_METHOD(target, "encodeALAC", EncodeALAC);
^
In file included from ../src/codec.cc:1:0:
/usr/include/nodejs/src/node.h:291:13: note: initializing argument 3 of ‘void node::NODE_SET_METHOD(v8::Local, const char, v8::FunctionCallback)’
inline void NODE_SET_METHOD(v8::Local recv,
^ ( )(const int&) {aka v8::Local ()(const int&)}’ to ‘v8::FunctionCallback {aka void ()(const v8::FunctionCallbackInfo&)}’ [-fpermissive]
NODE_SET_METHOD(target, "encryptAES", EncryptAES);
^
In file included from ../src/codec.cc:1:0:
/usr/include/nodejs/src/node.h:291:13: note: initializing argument 3 of ‘void node::NODE_SET_METHOD(v8::Local, const char, v8::FunctionCallback)’
inline void NODE_SET_METHOD(v8::Local recv,
^ ( )(const int&) {aka v8::Local ()(const int&)}’ to ‘v8::FunctionCallback {aka void ()(const v8::FunctionCallbackInfo&)}’ [-fpermissive]
NODE_SET_METHOD(target, "newEncoder", NewEncoder);
^
In file included from ../src/codec.cc:1:0:
/usr/include/nodejs/src/node.h:291:13: note: initializing argument 3 of ‘void node::NODE_SET_METHOD(v8::Local, const char*, v8::FunctionCallback)’
inline void NODE_SET_METHOD(v8::Local recv,
^
~../src/../alac/ALACAudioTypes.h:65:28: warning: multi-character character constant [-Wmultichar] kALACFormatLinearPCM = 'lpcm' ^~../src/../alac/ALACAudioTypes.h:154:22: warning: multi-character character constant [-Wmultichar] kALACCodecFormat = 'alac', ^~../src/../alac/ALACAudioTypes.h:182:26: warning: multi-character character constant [-Wmultichar] AudioChannelLayoutAID = 'chan' ^~../src/codec.cc: In function ‘void nodeairtunes::encoder_weak_callback(v8::Persistent~~../src/codec.cc:62:11: error: ‘class v8::Persistent~~ ../src/codec.cc: At global scope: ../src/codec.cc:67:32: error: ‘Arguments’ does not name a type Handle~~~~ ../src/codec.cc: In function ‘v8::Handle~~../src/codec.cc:78:97: warning: ‘static v8::Local~~~~~ ../src/codec.cc:78:98: error: no matching function for call to ‘v8::Persistent~~~~ /usr/include/nodejs/deps/v8/include/v8.h:9167:4: note: candidate expects 2 arguments, 1 provided ../src/codec.cc:79:15: error: base operand of ‘->’ has non-pointer type ‘v8::Persistent~~~~~~ ../src/codec.cc:98:34: error: invalid types ‘const int[int]’ for array subscript Local~~~~ ../src/codec.cc: In function ‘v8::Handle~~../src/codec.cc:119:11: error: request for member ‘Length’ in ‘args’, which is of non-class type ‘const int’ if(args.Length() < 2) { ^~../src/codec.cc:121:18: error: ‘class v8::HandleScope’ has no member named ‘Close’ return scope.Close(Null()); ^~~~~ ../src/codec.cc:121:29: error: too few arguments to function ‘v8::Local~~~~~~ ../src/codec.cc:154:51: error: invalid conversion from ‘v8::Handle~~~~~~ ../src/codec.cc:155:51: error: invalid conversion from ‘v8::Handle~~~~~~ airtunes.target.mk:101: recipe for target 'Release/obj.target/airtunes/src/codec.o' failed make: *** [Release/obj.target/airtunes/src/codec.o] Error 1 make: Leaving directory '/home/pi/babelpod/node_modules/airtunes/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.98-v7+ gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "rebuild" gyp ERR! cwd /home/pi/babelpod/node_modules/airtunes gyp ERR! node -v v8.11.1 gyp ERR! node-gyp -v v3.4.0 gyp ERR! not ok 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.Debiannpm ERR! airtunes@0.1.7 install:
node-gyp rebuild
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the airtunes@0.1.7 install script. npm ERR! This is most likely a problem with the airtunes package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get their info via: npm ERR! npm owner ls airtunes npm ERR! There is likely additional logging output above.npm ERR! System Linux 4.14.98-v7+ npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" npm ERR! cwd /home/pi/babelpod 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! /home/pi/babelpod/npm-debug.log npm ERR! not ok code 0
Please help I'm not the best at this stuff.