-
Notifications
You must be signed in to change notification settings - Fork 2k
Error running npm install #1159
Comments
We don't support Node 5 yet, please try with Node 4. |
Thanks for the reply, let me try it out |
No luck, still getting the error. (updated to node v4.2.6) mean@mean-VirtualBox:~/projects/rastay/rastay-api-backend$ npm install
|
> v8-debug@0.4.6 preinstall /home/mean/projects/rastay/rastay-api-backend/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-debug
>
-
> utf-8-validate@1.1.0 install /home/mean/projects/rastay/rastay-api-backend/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/ws/node_modules/utf-8-validate
> node-gyp rebuild
make: Entering directory '/home/mean/projects/rastay/rastay-api-backend/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/ws/node_modules/utf-8-validate/build'
CXX(target) Release/obj.target/validation/src/validation.o
In file included from ../src/validation.cc:15: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 ../src/validation.cc:10:0:
/home/mean/.node-gyp/4.2.6/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/mean/.node-gyp/4.2.6/include/node/node_buffer.h:31:40: note: conversion of argument 3 would be ill-formed:
In file included from ../src/validation.cc:15: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 ../src/validation.cc:10:0:
/home/mean/.node-gyp/4.2.6/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/mean/.node-gyp/4.2.6/include/node/node_buffer.h:43:40: note: conversion of argument 2 would be ill-formed:
In file included from ../src/validation.cc:15: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);
^
validation.target.mk:92: recipe for target 'Release/obj.target/validation/src/validation.o' failed
make: *** [Release/obj.target/validation/src/validation.o] Error 1
make: Leaving directory '/home/mean/projects/rastay/rastay-api-backend/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/ws/node_modules/utf-8-validate/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/mean/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270: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.2.0-16-generic
gyp ERR! command "/home/mean/local/bin/node" "/home/mean/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/mean/projects/rastay/rastay-api-backend/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/ws/node_modules/utf-8-validate
gyp ERR! node -v v4.2.6
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
|
@MSaifAsif - Are you running on a Windows machine? Perhaps your problem is the one detailed in this epic open issue on the node-gyp repo appropriately entitled: Read the instructions here: Note: my own experience here is the node-gyp issue did not resolve until installing Visual Studio 2015 and including the C++ options during install. |
@mg1075 Yeah I happened to come across that issue when google searching for this. But am actually on a linux machine (Ubuntu 14.04 to be exact). ../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/mean/.node-gyp/4.2.6/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/mean/.node-gyp/4.2.6/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/mean/.node-gyp/4.2.6/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/mean/.node-gyp/4.2.6/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); My system shows the following configs for g++ mean@mean-VirtualBox:~$ g++ --version
g++ (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
@MSaifAsif I build fine on 4.2.6. I am also on Ubuntu 14.04. do you have build_essentials installed via apt-get? Also do rm -rf node_modules, npm cache clean, and try npm install again. |
I'm experimenting exactly the same error. I also have and installed node following this instructions http://www.johnpapa.net/how-to-use-npm-global-without-sudo-on-osx/ I'm going to try what @trainerbill says and report back |
I ended downgrading the node to 0.12.9 and it worked. I did it following this steps: |
@weilah You should look into using nvm. Its a lifesafer |
Ended up downgrading and then followed what @trainerbill suggested. Builds fine now. |
So how might this work with node 6.3?I thought there were solutions out there for this... |
@dandart please open a new issue as this was not for Node 6.3. |
Using 0.12.18 worked. As easy as |
Hello,
I am facing an error when trying to run
npm install
. My environment is as belownode v5.5.0
npm 3.5.3
I installed node and npm using https://gist.github.com/isaacs/579814
Attaching error below
Any help would be appreciated !
The text was updated successfully, but these errors were encountered: