I'm trying to download certain packages like node-portaudio and image-to-ascii but an error is occuring. While there are many other packages that are being downloaded wothout any errors.
The error shown is :
> node-portaudio#0.4.10 install /home/ex-machina/Desktop/Project/node_modules/node-portaudio
> node-gyp rebuild
make: Entering directory '/home/ex-machina/Desktop/Project/node_modules/node-portaudio/build'
COPY ../build/Release/libportaudio.so.2
CXX(target) Release/obj.target/node_pa/src/node_pa.o
CXX(target) Release/obj.target/node_pa/src/GetDevices.o
CXX(target) Release/obj.target/node_pa/src/AudioIn.o
In file included from ../src/AudioIn.cc:20:0:
../src/Params.h: In member function ‘std::__cxx11::string streampunk::Params::unpackValue(v8::Local<v8::Value>)’:
../src/Params.h:41:48: warning: ‘v8::Local<v8::Value> v8::Object::Get(uint32_t)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
return *String::Utf8Value(valueArray->Get(0));
^
In file included from /home/ex-machina/.cache/node-gyp/12.17.0/include/node/v8-internal.h:14:0,
from /home/ex-machina/.cache/node-gyp/12.17.0/include/node/v8.h:27,
from /home/ex-machina/.cache/node-gyp/12.17.0/include/node/node.h:67,
from ../../nan/nan.h:56,
from ../src/AudioIn.cc:16:
/home/ex-machina/.cache/node-gyp/12.17.0/include/node/v8.h:3557:51: note:declared here
V8_DEPRECATED("Use maybe version", Local<Value> Get(uint32_t index));
^
/home/ex-machina/.cache/node-gyp/12.17.0/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’
declarator __attribute__((deprecated(message)))
^~~~~~~~~~
In file included from ../src/AudioIn.cc:20:0:
../src/Params.h:41:49: error: no matching function for call to ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>)’
return *String::Utf8Value(valueArray->Get(0));
^
In file included from /home/ex-machina/.cache/node-gyp/12.17.0/include/node/node.h:67:0,
from ../../nan/nan.h:56,
from ../src/AudioIn.cc:16:
/home/ex-machina/.cache/node-gyp/12.17.0/include/node/v8.h:3135:5: note: candidate: v8::String::Utf8Value::Utf8Value(v8::Isolate*, v8::Local<v8::Value>)
Utf8Value(Isolate* isolate, Local<v8::Value> obj);
^~~~~~~~~
/home/ex-machina/.cache/node-gyp/12.17.0/include/node/v8.h:3135:5: note: candidate expects 2 arguments, 1 provided
In file included from ../src/AudioIn.cc:20:0:
../src/Params.h: In member function ‘std::__cxx11::string streampunk::Params::unpackStr(v8::Local<v8::Object>, const string&, std::__cxx11::string)’:
../src/Params.h:64:38: error: no matching function for call to ‘v8::String::Utf8Value::Utf8Value(v8::Local<v8::Value>&)’
result = *String::Utf8Value(val);
^
In file included from /home/ex-machina/.cache/node-gyp/12.17.0/include/node/node.h:67:0,
from ../../nan/nan.h:56,
from ../src/AudioIn.cc:16:
/home/ex-machina/.cache/node-gyp/12.17.0/include/node/v8.h:3135:5: note: candidate: v8::String::Utf8Value::Utf8Value(v8::Isolate*, v8::Local<v8::Value>)
Utf8Value(Isolate* isolate, Local<v8::Value> obj);
^~~~~~~~~
/home/ex-machina/.cache/node-gyp/12.17.0/include/node/v8.h:3135:5: note: candidate expects 2 arguments, 1 provided
node_pa.target.mk:128: recipe for target 'Release/obj.target/node_pa/src/AudioIn.o' failed
make: *** [Release/obj.target/node_pa/src/AudioIn.o] Error 1
make: Leaving directory '/home/ex-machina/Desktop/Project/node_modules/node-portaudio/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/ex-machina/.nvm/versions/node/v12.17.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 5.3.0-51-generic
gyp ERR! command "/home/ex-machina/.nvm/versions/node/v12.17.0/bin/node" "/home/ex-machina/.nvm/versions/node/v12.17.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ex-machina/Desktop/Project/node_modules/node-portaudio
gyp ERR! node -v v12.17.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN project#1.0.0 No description
npm WARN project#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-portaudio#0.4.10 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-portaudio#0.4.10 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/ex-machina/.npm/_logs/2020-06-06T18_22_49_191Z-debug.log
I dont understand what's wrong. This is happening to only few packages. I've tried adding sudo but it doesn't work. How to resolve this?
This error could be because of Node JS Version installed on your machine. can you try updating the version or checking the version supported by that plugin
Related
I would like to have offline npm registery (like local repository) for npm modules
so I search and realized local-npm is a good idea for this.
I tried to install it but I have some problem.
I have error in installing local-npm
my command is
npm install -g local-npm --unsafe-perm=true --allow-root
and my error is:
../../nan/nan_object_wrap.h:66:61: required from here
/home/itis/.cache/node-gyp/10.24.0/include/node/v8.h:9502:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
make: *** [leveldown.target.mk:119: Release/obj.target/leveldown/src/batch.o] Error 1
make: Leaving directory '/usr/local/lib/node_modules/local-npm/node_modules/leveldown/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:191: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 4.18.0-348.el8.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/local-npm/node_modules/leveldown
gyp ERR! node -v v10.24.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! leveldown#1.7.2 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the leveldown#1.7.2 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/itis/.npm/_logs/2023-01-19T11_02_43_168Z-debug.log```
while upgrading the node version from 8 to 12, node-zopfli installation is failing with below errors:
from ../src/zopfli-binding.cc:1:
/home/.cache/node-gyp/12.16.1/include/node/v8.h:2672:44: note: candidate: v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const
V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
^~~~~~~~
/home/.cache/node-gyp/12.16.1/include/node/v8.h:2672:44: note: candidate expects 1 argument, 0 provided
In file included from /home/.cache/node-gyp/12.16.1/include/node/v8-internal.h:14:0,
from /home/.cache/node-gyp/12.16.1/include/node/v8.h:27,
from /home/.cache/node-gyp/12.16.1/include/node/node.h:63,
from ../src/zopfli-binding.cc:1:
/home/.cache/node-gyp/12.16.1/include/node/v8.h:2686:31: note: candidate: v8::Local<v8::Object> v8::Value::ToObject(v8::Isolate*) const
Local<Object> ToObject(Isolate* isolate) const);
^
/home/.cache/node-gyp/12.16.1/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’
declarator __attribute__((deprecated(message)))
^~~~~~~~~~
/home/.cache/node-gyp/12.16.1/include/node/v8.h:2686:31: note: candidate expects 1 argument, 0 provided
Local<Object> ToObject(Isolate* isolate) const);
^
/home/.cache/node-gyp/12.16.1/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’
declarator __attribute__((deprecated(message)))
^~~~~~~~~~
../src/zopfli-binding.cc:209:86: error: no matching function for call to ‘v8::Value::ToObject()’
const unsigned char * data = (const unsigned char*)Buffer::Data(inbuffer->ToObject());
^
In file included from /home/.cache/node-gyp/12.16.1/include/node/node.h:63:0,
from ../src/zopfli-binding.cc:1:
/home/.cache/node-gyp/12.16.1/include/node/v8.h:2672:44: note: candidate:
v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const
V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
^~~~~~~~
/home/.cache/node-gyp/12.16.1/include/node/v8.h:2672:44: note: candidate expects 1 argument, 0 provided
In file included from /home/.cache/node-gyp/12.16.1/include/node/v8-internal.h:14:0,
from /home/.cache/node-gyp/12.16.1/include/node/v8.h:27,
from /home/.cache/node-gyp/12.16.1/include/node/node.h:63,
from ../src/zopfli-binding.cc:1:
/home/.cache/node-gyp/12.16.1/include/node/v8.h:2686:31: note: candidate:
v8::Local<v8::Object> v8::Value::ToObject(v8::Isolate*) const
Local<Object> ToObject(Isolate* isolate) const);
^
/home/.cache/node-gyp/12.16.1/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’
declarator __attribute__((deprecated(message)))
^~~~~~~~~~
/home/.cache/node-gyp/12.16.1/include/node/v8.h:2686:31: note: candidate expects 1 argument, 0 provided
Local<Object> ToObject(Isolate* isolate) const);
^
/home/.cache/node-gyp/12.16.1/include/node/v8config.h:328:3: note: in definition of macro ‘V8_DEPRECATED’
declarator __attribute__((deprecated(message)))
^~~~~~~~~~
zopfli.target.mk:143: recipe for target 'Release/obj.target/zopfli/src/zopfli-binding.o' failed
make: *** [Release/obj.target/zopfli/src/zopfli-binding.o] Error 1
make: Leaving directory '/home/node_modules/node-zopfli/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/.nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:311:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 5.3.0-40-generic
gyp ERR! command "/home/.nvm/versions/node/v12.16.1/bin/node" "/home/.nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/node_modules/node-zopfli/lib/binding/node-v72-linux-x64/zopfli.node" "--module_name=zopfli" "--module_path=/home/node_modules/node-zopfli/lib/binding/node-v72-linux-x64"
gyp ERR! cwd /home/node_modules/node-zopfli
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/home/.nvm/versions/node/v12.16.1/bin/node /home/.nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/node_modules/node-zopfli/lib/binding/node-v72-linux-x64/zopfli.node --module_name=zopfli --module_path=/home/node_modules/node-zopfli/lib/binding/node-v72-linux-x64' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:311:20)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
node-pre-gyp ERR! System Linux 5.3.0-40-generic
node-pre-gyp ERR! command "/home/.nvm/versions/node/v12.16.1/bin/node" "/home/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/node_modules/node-zopfli
node-pre-gyp ERR! node -v v12.16.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute '/home/.nvm/versions/node/v12.16.1/bin/node /home/.nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/node_modules/node-zopfli/lib/binding/node-v72-linux-x64/zopfli.node --module_name=zopfli --module_path=/home/node_modules/node-zopfli/lib/binding/node-v72-linux-x64' (1)
zopfli.target.mk:143: recipe for target 'Release/obj.target/zopfli/src/zopfli-binding.o' failedl script
make: *** [Release/obj.target/zopfli/src/zopfli-binding.o] Error 1
make: Leaving directory '/home/node_modules/node-zopfli/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/.nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:311:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 5.3.0-40-generic
gyp ERR! command "/home/.nvm/versions/node/v12.16.1/bin/node" "/home/.nvm/versions/node/v12.16.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/node_modules/node-zopfli/lib/binding/node-v72-linux-x64/zopfli.node" "--module_name=zopfli" "--module_path=/home/node_modules/node-zopfli/lib/binding/node-v72-linux-x64"
gyp ERR! cwd /home/node_modules/node-zopfli
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.11 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-zopfli#1.4.0 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-zopfli#1.4.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/.npm/_logs/2020-03-16T07_09_26_729Z-debug.log
It's showing the cache issue, checked after clearing the cache and tried updating the same as well as different packages. Still, the same issue is occurring. Is this due to version or anything else. Any solution?
Thanks in advance.
It's been a while since this was asked, and I don't have an explanation, but I do have a possible solution:
Try run:
npm install -g node-gyp#latest
npm update node-sass npm update node scripts
npm rebuild node-sass
npm install --build-from-source node-zopfli
rm -rf node_modules
npm install --save react react-dom react-scripts
npm rebuild node-sass
Now try to run the project.
I'm currently working on an old project. not sure why it's built the way it does, or what is it with node-zopfli#1.4.0, but I'm now able to run the project.
I can't install web3(1.2.4) on webstorm(on mac). I tried re-install webstorm, but it didn't work. My environment is mac os(10.14.6) & webstorm(2019.2.4).
Error messages are as follows:
/Users/Pierogi/Library/Preferences/WebStorm2019.2/node/node-v10.16.0-darwin-x64/bin/node /Users/Pierogi/Library/Preferences/WebStorm2019.2/node/node-v10.16.0-darwin-x64/lib/node_modules/npm/bin/npm-cli.js install web3#1.2.4
Standard error:
npm WARN deprecated #types/bignumber.js#5.0.0: This is a stub types definition for bignumber.js (https://github.com/MikeMcl/bignumber.js/). bignumber.js provides its own type definitions, so you don't need #types/bignumber.js installed!
npm WARN lifecycle The node binary used for scripts is /usr/local/bin/node but npm is using /Users/Pierogi/Library/Preferences/WebStorm2019.2/node/node-v10.16.0-darwin-x64/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
In file included from ../src/addon.cpp:9:
In file included from ../src/KeccakNISTInterface.h:17:
../src/KeccakSponge.h:23:9: warning: 'ALIGN' macro redefined [-Wmacro-redefined]
#define ALIGN __attribute__ ((aligned(32)))
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/i386/param.h:83:9: note: previous definition is here
#define ALIGN(p) __DARWIN_ALIGN(p)
^
../src/addon.cpp:83:11: error: no matching member function for call to 'Set'
target->Set(className, f);
~~~~~~~~^~~
/Users/Pierogi/Library/Caches/node-gyp/13.1.0/include/node/v8.h:3424:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
^
/Users/Pierogi/Library/Caches/node-gyp/13.1.0/include/node/v8.h:3427:37: note: candidate function not viable: requires 3 arguments, but 2 were provided
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
^
1 warning and 1 error generated.
make: *** [Release/obj.target/sha3/src/addon.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/Pierogi/Library/Preferences/WebStorm2019.2/node/node-v10.16.0-darwin-x64/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:210:5)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 18.7.0
gyp ERR! command "/usr/local/Cellar/node/13.1.0/bin/node" "/Users/Pierogi/Library/Preferences/WebStorm2019.2/node/node-v10.16.0-darwin-x64/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/Pierogi/Documents/WebStorm project/191112/node_modules/sha3
gyp ERR! node -v v13.1.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm WARN bookshelf#1.0.1 requires a peer of knex#>=0.15.0 <0.20.0 but none is installed. You must install peer dependencies yourself.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sha3#1.2.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sha3#1.2.3 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! /Users/Pierogi/.npm/_logs/2019-11-19T13_11_28_555Z-debug.log
Standard output:
> sha3#1.2.3 install /Users/Pierogi/Documents/WebStorm project/191112/node_modules/sha3
> node-gyp rebuild
CXX(target) Release/obj.target/sha3/src/addon.o
Process finished with exit code 1
Try to install compilers and some supporting utilities by running:
xcode-select --install
Node version v4.0.0
npm verison v2.14.2
i've tried to installing node-pre-gyp & node-gyp, which seem to install fine. i've also tried to install a specific serialport v1.7.4 version. I've also tryed adding the unsafe--perm. All don't work when installing serialport
when running
sudo npm install serialport --unsafe-perm
i get the following error. I think it might be because my c++ compiler is outdated and node is trying to install non compatible node-pre-gyp. I'm both not sure what problem it is and how to solve it.
node-pre-gyp ERR! Tried to download(404): https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.7/serialport-v4.0.7-node-v46-linux-arm.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for serialport#4.0.7 and node#4.0.0 (node-v46 ABI) (falling back to source compile with node-gyp)
make: Entering directory '/home/pi/node_modules/serialport/build'
CXX(target) Release/obj.target/serialport/src/serialport.o
In file included from ../src/./serialport.h:7:0,
from ../src/serialport.cpp:1:
../node_modules/nan/nan.h:43:3: error: #error This version of node/NAN/v8 requires a C++11 compiler
In file included from /root/.node-gyp/4.0.0/include/node/node.h:42:0,
from ../node_modules/nan/nan.h:47,
from ../src/./serialport.h:7,
from ../src/serialport.cpp:1:
/root/.node-gyp/4.0.0/include/node/v8.h:336:1: error: expected unqualified-id before ‘using’
/root/.node-gyp/4.0.0/include/node/v8.h:469:1: error: expected unqualified-id before ‘using’
/root/.node-gyp/4.0.0/include/node/v8.h:852:1: error: expected unqualified-id before ‘using’
In file included from ../node_modules/nan/nan.h:190:0,
from ../src/./serialport.h:7,
from ../src/serialport.cpp:1:
../node_modules/nan/nan_new.h:225:1: note: template<class T, class A0, class A1, class A2, class A3> typename Nan::imp::Factory<T>::return_t Nan::New(A0, A1, A2, A3)
../node_modules/nan/nan_new.h:237:1: note: template<class T> typename Nan::imp::Factory::return_t Nan::New(Nan::FunctionCallback, v8::Local<v8::Value>)
../node_modules/nan/nan_new.h:245:1: note: template<class T, class A2> typename Nan::imp::Factory<T>::return_t Nan::New(Nan::FunctionCallback, v8::Local<v8::Value>, A2)
../src/serialport.cpp: At global scope:
../src/serialport.cpp:653:17: error: variable or field ‘init’ declared void
../src/serialport.cpp:653:13: error: ‘Handle’ is not a member of ‘v8’
../src/serialport.cpp:653:34: error: expected primary-expression before ‘>’ token
../src/serialport.cpp:653:36: error: ‘target’ was not declared in this scope
../src/serialport.cpp:670:1: error: ‘init’ was not declared in this scope
../node_modules/nan/nan_new.h: In function ‘v8::Local<T> Nan::imp::To(v8::Local<v8::Integer>) [with T = v8::Int32]’:
../node_modules/nan/nan_new.h:29:1: warning: control reaches end of non-void function [-Wreturn-type]
../src/serialport.cpp: In function ‘v8::Local<v8::Value> getValueFromObject(v8::Local<v8::Object>, std::string)’:
../src/serialport.cpp:87:1: warning: control reaches end of non-void function [-Wreturn-type]
serialport.target.mk:96: recipe for target 'Release/obj.target/serialport/src/serialport.o' failed
make: *** [Release/obj.target/serialport/src/serialport.o] Error 1
make: Leaving directory '/home/pi/node_modules/serialport/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/pi/node_modules/node-gyp/lib/build.js:285:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.1.19-v7+
gyp ERR! command "/usr/local/bin/node" "/home/pi/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/pi/node_modules/serialport/build/Release/serialport.node" "--module_name=serialport" "--module_path=/home/pi/node_modules/serialport/build/Release"
gyp ERR! cwd /home/pi/node_modules/serialport
gyp ERR! node -v v4.0.0
gyp ERR! node-gyp -v v3.6.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /home/pi/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/pi/node_modules/serialport/build/Release/serialport.node --module_name=serialport --module_path=/home/pi/node_modules/serialport/build/Release' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/pi/node_modules/serialport/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at emitTwo (events.js:87:13)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:172:7)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:817:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Linux 4.1.19-v7+
node-pre-gyp ERR! command "/usr/local/bin/node" "/home/pi/node_modules/serialport/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/pi/node_modules/serialport
node-pre-gyp ERR! node -v v4.0.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.32
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /home/pi/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/pi/node_modules/serialport/build/Release/serialport.node --module_name=serialport --module_path=/home/pi/node_modules/serialport/build/Release' (1)
npm ERR! Linux 4.1.19-v7+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "serialport" "--unsafe-perm"
npm ERR! node v4.0.0
npm ERR! npm v2.14.2
npm ERR! code ELIFECYCLE
npm ERR! serialport#4.0.7 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serialport#4.0.7 install script 'node-pre-gyp install --fallback-to-build'.
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! Please include the following file with any support request:
npm ERR! /home/pi/Desktop/QuadLink/npm-debug.log
Try this. it works npm install serialport --build-from-source
Try this:
npm i serialport --unsafe-perm --build-from-source
I'm not able to make a complete npm install. Whenever I try, I get this message:
node-pre-gyp ERR! Tried to download: https://node-inspector.s3.amazonaws.com/debug/v0.4.6/node-v46-linux-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for v8-debug#0.4.6 and node#4.4.5 (node-v46 ABI) (falling back to source compile with node-gyp)
I'm using
node v4.4.5
npm v2.2.5
I was getting similar error on node v6.2.1
Complete message:
dushyant#dushyant-3543:/mnt/f/git/existing$ npm install
npm WARN package.json angle#0.0.1 No repository field.
npm WARN package.json angle#0.0.1 No license field.
> v8-debug#0.4.6 preinstall /mnt/f/git/existing/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-debug
>
> v8-profiler#5.2.12 preinstall /mnt/f/git/existing/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-profiler
>
> ws#0.4.32 install /mnt/f/git/existing/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/ws
> (node-gyp rebuild 2> builderror.log) || (exit 0)
make: Entering directory '/mnt/f/git/existing/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/ws/build' CXX(target) Release/obj.target/bufferutil/src/bufferutil.o bufferutil.target.mk:92: recipe for target 'Release/obj.target/bufferutil/src/bufferutil.o' failed make: Leaving directory '/mnt/f/git/existing/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/ws/build'
> v8-debug#0.4.6 install /mnt/f/git/existing/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-debug
> node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download: https://node-inspector.s3.amazonaws.com/debug/v0.4.6/node-v46-linux-x64.tar.gz node-pre-gyp ERR! Pre-built binaries not found for v8-debug#0.4.6 and node#4.4.5 (node-v46 ABI) (falling back to source compile with node-gyp) make: Entering directory '/mnt/f/git/existing/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-debug/build' CXX(target) Release/obj.target/debug/src/debug.o In file included from ../src/debug.cc:2:0: ../node_modules/nan/nan.h:261:25: error: redefinition of ‘template<class T> v8::Local<T>
_NanEnsureLocal(v8::Local<T>)’ NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
^ ../node_modules/nan/nan.h:256:25: note: ‘template<class T> v8::Local<T> _NanEnsureLocal(v8::Handle<T>)’ previously declared here NAN_INLINE v8::Local<T>
_NanEnsureLocal(v8::Handle<T> val) {
^ ../node_modules/nan/nan.h:661:13: error: ‘node::smalloc’ has not been declared
, node::smalloc::FreeCallback callback
^ ../node_modules/nan/nan.h:661:35: error: expected ‘,’ or ‘...’ before ‘callback’
, node::smalloc::FreeCallback callback
^ ../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)’: ../node_modules/nan/nan.h:665:50: error: ‘callback’ was not declared in this scope
v8::Isolate::GetCurrent(), data, length, callback, hint);
^ ../node_modules/nan/nan.h:665:60: error: ‘hint’ was not declared in this scope
v8::Isolate::GetCurrent(), data, length, callback, hint);
^ ../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)’: ../node_modules/nan/nan.h:672:67: error: no matching function for call to ‘New(v8::Isolate*, const char*&, uint32_t&)’
return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
^ In file included from ../node_modules/nan/nan.h:25:0,
from ../src/debug.cc:2: /home/dushyant/.node-gyp/4.4.5/include/node/node_buffer.h:31:40: note: candidate: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, v8::Local<v8::String>, node::encoding) <near match> NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
^ /home/dushyant/.node-gyp/4.4.5/include/node/node_buffer.h:31:40: note: conversion of argument 3 would be ill-formed: In file included from ../src/debug.cc:2:0: ../node_modules/nan/nan.h:672:67: error: invalid conversion from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’ [-fpermissive]
return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
^ In file included from ../node_modules/nan/nan.h:25:0,
from ../src/debug.cc:2: /home/dushyant/.node-gyp/4.4.5/include/node/node_buffer.h:43:40: note: candidate: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match> NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
^ /home/dushyant/.node-gyp/4.4.5/include/node/node_buffer.h:43:40: note: conversion of argument 2 would be ill-formed: In file included from ../src/debug.cc:2:0: ../node_modules/nan/nan.h:672:67: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
^ ../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’: ../node_modules/nan/nan.h:676:29: error: could not convert ‘node::Buffer::New(v8::Isolate::GetCurrent(), ((size_t)size))’ from ‘v8::MaybeLocal<v8::Object>’ to ‘v8::Local<v8::Object>’
return node::Buffer::New(v8::Isolate::GetCurrent(), size);
^ ../node_modules/nan/nan.h: In function ‘v8::Local<v8::Object> NanBufferUse(char*, uint32_t)’: ../node_modules/nan/nan.h:683:12: error: ‘Use’ is not a member of ‘node::Buffer’
return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
^ ../src/debug.cc: In static member function ‘static void nodex::Debug::InternalConstructorName(const v8::FunctionCallbackInfo<v8::Value>&)’: ../src/debug.cc:194:23: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
result_type = "";
^ debug.target.mk:90: recipe for target 'Release/obj.target/debug/src/debug.o' failed make: *** [Release/obj.target/debug/src/debug.o] Error 1 make: Leaving directory '/mnt/f/git/existing/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-debug/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:276:23) gyp ERR! stack at emitTwo (events.js:87:13) gyp ERR! stack at ChildProcess.emit (events.js:172:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12) gyp ERR! System Linux 4.4.0-24-generic gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/mnt/f/git/existing/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-debug/build/debug/v0.4.6/node-v46-linux-x64/debug.node" "--module_name=debug" "--module_path=/mnt/f/git/existing/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-debug/build/debug/v0.4.6/node-v46-linux-x64" gyp ERR! cwd /mnt/f/git/existing/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-debug gyp ERR! node -v v4.4.5 gyp ERR! node-gyp -v v3.3.1 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/nodejs /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build
--fallback-to-build --module=/mnt/f/git/existing/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-debug/build/debug/v0.4.6/node-v46-linux-x64/debug.node
--module_name=debug --module_path=/mnt/f/git/existing/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-debug/build/debug/v0.4.6/node-v46-linux-x64' (1) node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/mnt/f/git/existing/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-debug/node_modules/node-pre-gyp/lib/util/compile.js:83:29) node-pre-gyp ERR! stack at emitTwo (events.js:87:13) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:172:7) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:827:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) node-pre-gyp ERR! System Linux
4.4.0-24-generic node-pre-gyp ERR! command "/usr/bin/nodejs" "/mnt/f/git/existing/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-debug/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd /mnt/f/git/existing/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-debug node-pre-gyp ERR! node -v v4.4.5 node-pre-gyp ERR! node-pre-gyp -v v0.6.28 node-pre-gyp ERR! not ok Failed to execute '/usr/bin/nodejs /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build
--fallback-to-build --module=/mnt/f/git/existing/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-debug/build/debug/v0.4.6/node-v46-linux-x64/debug.node
--module_name=debug --module_path=/mnt/f/git/existing/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-debug/build/debug/v0.4.6/node-v46-linux-x64' (1)
> v8-profiler#5.2.12 install /mnt/f/git/existing/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-profiler
> node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download: https://node-inspector.s3.amazonaws.com/profiler/v5.2.12/node-v46-linux-x64.tar.gz node-pre-gyp ERR! Pre-built binaries not found for v8-profiler#5.2.12 and node#4.4.5 (node-v46 ABI) (falling back to source compile with node-gyp) make: Entering directory '/mnt/f/git/existing/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-profiler/build' CXX(target) Release/obj.target/profiler/src/profiler.o CXX(target) Release/obj.target/profiler/src/cpu_profiler.o CXX(target) Release/obj.target/profiler/src/cpu_profile.o CXX(target) Release/obj.target/profiler/src/cpu_profile_node.o CXX(target) Release/obj.target/profiler/src/heap_profiler.o CXX(target) Release/obj.target/profiler/src/heap_snapshot.o CXX(target) Release/obj.target/profiler/src/heap_output_stream.o CXX(target) Release/obj.target/profiler/src/heap_graph_node.o CXX(target) Release/obj.target/profiler/src/heap_graph_edge.o SOLINK_MODULE(target) Release/obj.target/profiler.node COPY Release/profiler.node COPY /mnt/f/git/existing/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-profiler/build/profiler/v5.2.12/node-v46-linux-x64/profiler.node TOUCH Release/obj.target/action_after_build.stamp make: Leaving directory '/mnt/f/git/existing/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-profiler/build' npm ERR! Linux 4.4.0-24-generic npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" npm ERR! node v4.4.5 npm ERR! npm v2.15.5 npm ERR! code ELIFECYCLE
npm ERR! v8-debug#0.4.6 install: `node-pre-gyp install
--fallback-to-build` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the v8-debug#0.4.6 install script 'node-pre-gyp install
--fallback-to-build'. npm ERR! This is most likely a problem with the v8-debug 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 information on how to open an issue for this project with: npm ERR! npm bugs v8-debug npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm ERR! npm owner ls v8-debug npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request: npm ERR! /mnt/f/git/existing/npm-debug.log
It seems that you are installing node-inspector.
It is relevant to the version of node.
I meet the same issue when I use 7.6.0, but I downgraded to 6.9.5. I install node-inspector successfully.
The same issue, node-inspector install failed issue.
As mention that how to downgrade, you can do as follows,
checkout nodejs project
sudo ./configure
sudo make
sudo make install
then you node -v, you can see the current version of node that you want.