Apparently node-grok can't be installed with Node 4.x or 5.x currently. I first suspected a problem with "gyp" but reading a lot of issues of other packages it seems like node-grok should have its dependencies updated. Anyway… I'm just a beginner regarding NodeJS. Here is the verbatim build error:
root@5e872589773d:/# npm install node-grok
> oniguruma@4.2.4 install /node_modules/oniguruma
> node-gyp rebuild
make: Entering directory `/node_modules/oniguruma/build'
CC(target) Release/obj.target/oniguruma/deps/onig/regcomp.o
CC(target) Release/obj.target/oniguruma/deps/onig/regenc.o
CC(target) Release/obj.target/oniguruma/deps/onig/regerror.o
CC(target) Release/obj.target/oniguruma/deps/onig/regexec.o
CC(target) Release/obj.target/oniguruma/deps/onig/regext.o
CC(target) Release/obj.target/oniguruma/deps/onig/reggnu.o
CC(target) Release/obj.target/oniguruma/deps/onig/regparse.o
CC(target) Release/obj.target/oniguruma/deps/onig/regposerr.o
CC(target) Release/obj.target/oniguruma/deps/onig/regposix.o
CC(target) Release/obj.target/oniguruma/deps/onig/regsyntax.o
CC(target) Release/obj.target/oniguruma/deps/onig/regtrav.o
CC(target) Release/obj.target/oniguruma/deps/onig/regversion.o
CC(target) Release/obj.target/oniguruma/deps/onig/st.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/ascii.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/big5.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/cp1251.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/euc_jp.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/euc_kr.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/euc_tw.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/gb18030.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_1.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_2.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_3.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_4.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_5.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_6.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_7.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_8.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_9.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_10.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_11.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_13.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_14.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_15.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/iso8859_16.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/koi8.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/koi8_r.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/mktable.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/sjis.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/unicode.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf16_be.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf16_le.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf32_be.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf32_le.o
CC(target) Release/obj.target/oniguruma/deps/onig/enc/utf8.o
AR(target) Release/obj.target/oniguruma.a
COPY Release/oniguruma.a
CXX(target) Release/obj.target/onig_scanner/src/onig-cache.o
In file included from ../src/onig-reg-exp.h:7:0,
from ../src/onig-cache.h:4,
from ../src/onig-cache.cc:1:
../../nan/nan.h:260:25: error: redefinition of 'template<class T> v8::Local<T> _NanEnsureLocal(v8::Local<T>)'
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Local<T> val) {
^
../../nan/nan.h:255:25: error: 'template<class T> v8::Local<T> _NanEnsureLocal(v8::Handle<T>)' previously declared here
NAN_INLINE v8::Local<T> _NanEnsureLocal(v8::Handle<T> val) {
^
../../nan/nan.h:660:13: error: 'node::smalloc' has not been declared
, node::smalloc::FreeCallback callback
^
../../nan/nan.h:660:35: error: expected ',' or '...' before 'callback'
, node::smalloc::FreeCallback callback
^
../../nan/nan.h: In function 'v8::Local<v8::Object> NanNewBufferHandle(char*, size_t, int)':
../../nan/nan.h:664:50: error: 'callback' was not declared in this scope
v8::Isolate::GetCurrent(), data, length, callback, hint);
^
../../nan/nan.h:664:60: error: 'hint' was not declared in this scope
v8::Isolate::GetCurrent(), data, length, callback, hint);
^
../../nan/nan.h: In function 'v8::Local<v8::Object> NanNewBufferHandle(const char*, uint32_t)':
../../nan/nan.h:671:67: error: call of overloaded 'New(v8::Isolate*, const char*&, uint32_t&)' is ambiguous
return node::Buffer::New(v8::Isolate::GetCurrent(), data, size);
^
../../nan/nan.h:671:67: note: candidates are:
In file included from ../../nan/nan.h:25:0,
from ../src/onig-reg-exp.h:7,
from ../src/onig-cache.h:4,
from ../src/onig-cache.cc:1:
/root/.node-gyp/5.4.0/include/node/node_buffer.h:31:40: note: 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,
^
/root/.node-gyp/5.4.0/include/node/node_buffer.h:31:40: note: no known conversion for argument 3 from 'uint32_t {aka unsigned int}' to 'node::encoding'
/root/.node-gyp/5.4.0/include/node/node_buffer.h:43:40: note: v8::MaybeLocal<v8::Object> node::Buffer::New(v8::Isolate*, char*, size_t) <near match>
NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate,
^
/root/.node-gyp/5.4.0/include/node/node_buffer.h:43:40: note: no known conversion for argument 2 from 'const char*' to 'char*'
In file included from ../src/onig-reg-exp.h:7:0,
from ../src/onig-cache.h:4,
from ../src/onig-cache.cc:1:
../../nan/nan.h: In function 'v8::Local<v8::Object> NanNewBufferHandle(uint32_t)':
../../nan/nan.h:675:61: 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);
^
../../nan/nan.h: In function 'v8::Local<v8::Object> NanBufferUse(char*, uint32_t)':
../../nan/nan.h:682:12: error: 'Use' is not a member of 'node::Buffer'
return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
^
make: *** [Release/obj.target/onig_scanner/src/onig-cache.o] Error 1
make: Leaving directory `/node_modules/oniguruma/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.2.0-22-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /node_modules/oniguruma
gyp ERR! node -v v5.4.0
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '/package.json'
npm WARN !invalid#1 No description
npm WARN !invalid#1 No repository field.
npm WARN !invalid#1 No README data
npm WARN !invalid#1 No license field.
npm ERR! Linux 4.2.0-22-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "node-grok"
npm ERR! node v5.4.0
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! oniguruma@4.2.4 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the oniguruma@4.2.4 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the oniguruma 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 information on how to open an issue for this project with:
npm ERR! npm bugs oniguruma
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls oniguruma
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /npm-debug.log
Apparently node-grok can't be installed with Node 4.x or 5.x currently. I first suspected a problem with "gyp" but reading a lot of issues of other packages it seems like node-grok should have its dependencies updated. Anyway… I'm just a beginner regarding NodeJS. Here is the verbatim build error: