Closed vinhlh closed 9 years ago
I got similar error when run npm install aws-iot-device-sdk
> bufferutil@1.1.0 install /data/aws/node_modules/bufferutil
> node-gyp rebuild
make: Entering directory `/data/aws/node_modules/bufferutil/build'
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
In file included from ../src/bufferutil.cc:16:0:
../../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) {
^
../../nan/nan.h:256: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:661:13: error: ‘node::smalloc’ has not been declared
, node::smalloc::FreeCallback callback
^
../../nan/nan.h:661: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:665:50: error: ‘callback’ was not declared in this scope
v8::Isolate::GetCurrent(), data, length, callback, hint);
^
../../nan/nan.h:665: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:672: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:672:67: note: candidates are:
In file included from ../src/bufferutil.cc:10:0:
/home/ubuntu/.node-gyp/4.0.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,
^
/home/ubuntu/.node-gyp/4.0.0/include/node/node_buffer.h:31:40: note: no known conversion for argument 3 from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’
/home/ubuntu/.node-gyp/4.0.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,
^
/home/ubuntu/.node-gyp/4.0.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/bufferutil.cc:16:0:
../../nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’:
../../nan/nan.h:676: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:683:12: error: ‘Use’ is not a member of ‘node::Buffer’
return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
^
make: *** [Release/obj.target/bufferutil/src/bufferutil.o] Error 1
make: Leaving directory `/data/aws/node_modules/bufferutil/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/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 3.13.0-57-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /data/aws/node_modules/bufferutil
gyp ERR! node -v v4.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:bufferutil bufferutil@1.1.0 install: `node-gyp rebuild`
npm WARN install:bufferutil Exit status 1
> utf-8-validate@1.1.0 install /data/aws/node_modules/utf-8-validate
> node-gyp rebuild
make: Entering directory `/data/aws/node_modules/utf-8-validate/build'
CXX(target) Release/obj.target/validation/src/validation.o
In file included from ../src/validation.cc:15:0:
../../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) {
^
../../nan/nan.h:256: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:661:13: error: ‘node::smalloc’ has not been declared
, node::smalloc::FreeCallback callback
^
../../nan/nan.h:661: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:665:50: error: ‘callback’ was not declared in this scope
v8::Isolate::GetCurrent(), data, length, callback, hint);
^
../../nan/nan.h:665: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:672: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:672:67: note: candidates are:
In file included from ../src/validation.cc:10:0:
/home/ubuntu/.node-gyp/4.0.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,
^
/home/ubuntu/.node-gyp/4.0.0/include/node/node_buffer.h:31:40: note: no known conversion for argument 3 from ‘uint32_t {aka unsigned int}’ to ‘node::encoding’
/home/ubuntu/.node-gyp/4.0.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,
^
/home/ubuntu/.node-gyp/4.0.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/validation.cc:15:0:
../../nan/nan.h: In function ‘v8::Local<v8::Object> NanNewBufferHandle(uint32_t)’:
../../nan/nan.h:676: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:683:12: error: ‘Use’ is not a member of ‘node::Buffer’
return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
^
make: *** [Release/obj.target/validation/src/validation.o] Error 1
make: Leaving directory `/data/aws/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 (/usr/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 3.13.0-57-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /data/aws/node_modules/utf-8-validate
gyp ERR! node -v v4.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:utf-8-validate utf-8-validate@1.1.0 install: `node-gyp rebuild`
npm WARN install:utf-8-validate Exit status 1
/data/aws
└─┬ aws-iot-device-sdk@1.0.4
├── blessed@0.1.81
├─┬ blessed-contrib@2.3.3
│ ├── ansi-term@0.0.1
│ ├─┬ chalk@1.1.1
│ │ ├── ansi-styles@2.1.0
│ │ ├── escape-string-regexp@1.0.3
│ │ ├─┬ has-ansi@2.0.0
│ │ │ └── ansi-regex@2.0.0
│ │ ├── strip-ansi@3.0.0
│ │ └── supports-color@2.0.0
│ ├─┬ drawille-canvas-blessed-contrib@0.1.2
│ │ ├── bresenham@0.0.3
│ │ ├── drawille-blessed-contrib@1.0.0
│ │ └── gl-matrix@2.3.1
│ ├── lodash@3.10.1
│ ├─┬ map-canvas@0.1.5
│ │ └─┬ xml2js@0.4.12
│ │ ├── sax@1.1.3
│ │ └── xmlbuilder@3.1.0
│ ├── marked@0.3.5
│ ├─┬ marked-terminal@1.6.1
│ │ ├─┬ cardinal@0.5.0
│ │ │ ├── ansicolors@0.2.1
│ │ │ └─┬ redeyed@0.5.0
│ │ │ └── esprima-fb@12001.1.0-dev-harmony-fb
│ │ ├─┬ cli-table@0.3.1
│ │ │ └── colors@1.0.3
│ │ ├─┬ lodash.assign@3.2.0
│ │ │ ├─┬ lodash._baseassign@3.2.0
│ │ │ │ └── lodash._basecopy@3.0.1
│ │ │ ├─┬ lodash._createassigner@3.1.1
│ │ │ │ ├── lodash._bindcallback@3.0.1
│ │ │ │ ├── lodash._isiterateecall@3.0.9
│ │ │ │ └── lodash.restparam@3.6.1
│ │ │ └─┬ lodash.keys@3.1.2
│ │ │ ├── lodash._getnative@3.9.1
│ │ │ ├── lodash.isarguments@3.0.4
│ │ │ └── lodash.isarray@3.0.4
│ │ └── node-emoji@0.1.0
│ ├── memory-streams@0.1.0
│ ├── memorystream@0.3.1
│ ├─┬ picture-tube@0.0.4
│ │ ├── buffers@0.1.1
│ │ ├── charm@0.1.2
│ │ ├─┬ event-stream@0.9.8
│ │ │ └── optimist@0.2.8
│ │ ├─┬ optimist@0.3.7
│ │ │ └── wordwrap@0.0.3
│ │ ├── png-js@0.1.1
│ │ ├── request@2.9.203
│ │ └── x256@0.0.2
│ ├─┬ request@2.65.0
│ │ ├── aws-sign2@0.6.0
│ │ ├─┬ bl@1.0.0
│ │ │ └── readable-stream@2.0.2
│ │ ├── caseless@0.11.0
│ │ ├─┬ combined-stream@1.0.5
│ │ │ └── delayed-stream@1.0.0
│ │ ├── extend@3.0.0
│ │ ├── forever-agent@0.6.1
│ │ ├─┬ form-data@1.0.0-rc3
│ │ │ └── async@1.4.2
│ │ ├─┬ har-validator@2.0.2
│ │ │ ├─┬ commander@2.8.1
│ │ │ │ └── graceful-readlink@1.0.1
│ │ │ ├─┬ is-my-json-valid@2.12.2
│ │ │ │ ├── generate-function@2.0.0
│ │ │ │ ├─┬ generate-object-property@1.2.0
│ │ │ │ │ └── is-property@1.0.2
│ │ │ │ └── jsonpointer@2.0.0
│ │ │ └─┬ pinkie-promise@1.0.0
│ │ │ └── pinkie@1.0.0
│ │ ├─┬ hawk@3.1.0
│ │ │ ├── boom@2.9.0
│ │ │ ├── cryptiles@2.0.5
│ │ │ ├── hoek@2.16.3
│ │ │ └── sntp@1.0.9
│ │ ├─┬ http-signature@0.11.0
│ │ │ ├── asn1@0.1.11
│ │ │ ├── assert-plus@0.1.5
│ │ │ └── ctype@0.5.3
│ │ ├── isstream@0.1.2
│ │ ├── json-stringify-safe@5.0.1
│ │ ├─┬ mime-types@2.1.7
│ │ │ └── mime-db@1.19.0
│ │ ├── node-uuid@1.4.3
│ │ ├── oauth-sign@0.8.0
│ │ ├── qs@5.2.0
│ │ ├── stringstream@0.0.4
│ │ ├── tough-cookie@2.2.0
│ │ └── tunnel-agent@0.4.1
│ ├─┬ sparkline@0.1.2
│ │ ├── here@0.0.2
│ │ └─┬ nopt@2.1.2
│ │ └── abbrev@1.0.7
│ └── term-canvas@0.0.5
├── minimist@1.2.0
└─┬ mqtt@1.3.5
├─┬ commist@1.0.0
│ └── leven@1.0.2
├─┬ concat-stream@1.5.0
│ ├─┬ readable-stream@2.0.2
│ │ ├── process-nextick-args@1.0.3
│ │ └── util-deprecate@1.0.2
│ └── typedarray@0.0.6
├─┬ end-of-stream@1.1.0
│ └─┬ once@1.3.2
│ └── wrappy@1.0.1
├─┬ help-me@0.1.0
│ └── pump@1.0.0
├── inherits@2.0.1
├─┬ mqtt-connection@2.1.1
│ ├── reduplexer@1.1.0
│ └── through2@0.6.5
├─┬ mqtt-packet@3.4.3
│ └── bl@0.9.4
├─┬ readable-stream@1.0.33
│ ├── core-util-is@1.0.1
│ ├── isarray@0.0.1
│ └── string_decoder@0.10.31
├─┬ websocket-stream@1.5.2
│ ├─┬ duplexify@3.4.2
│ │ ├── end-of-stream@1.0.0
│ │ └── readable-stream@2.0.2
│ └─┬ ws@0.7.2
│ ├── options@0.0.6
│ └── ultron@1.0.2
└── xtend@4.0.0
npm WARN ENOENT ENOENT: no such file or directory, open '/data/aws/package.json'
npm WARN EPACKAGEJSON /data/aws No description
npm WARN EPACKAGEJSON /data/aws No repository field.
npm WARN EPACKAGEJSON /data/aws No README data
npm WARN EPACKAGEJSON /data/aws No license field.
node version: v4.0.0 npm version: 3.3.6
Hello,
Thanks for letting us know about this issue. We have investigated the problem and were able to duplicate it on a node 4.1.1 installation. We will fix this in the next release, but in the meantime you can fix it yourself by changing the version of “mqtt” in the “dependencies” section from “1.3.5” to “1.4.3” as shown below. Thanks again for helping us find this issue, and let us know if that fixes the problem.
30c30
< "mqtt": "1.3.5",
---
> "mqtt": "1.4.3",
Changing the version of "mqtt" from "1.3.5" to "1.4.3" fix my issue on node version 4.0.0. Thanks!
Hi I have a similar issue. The MQTT version is 1.4.3 as advised. Yet I am not able to have a successful build "mqtt": "1.4.3", "minimist": "1.2.0"
Node version is v4.2.2 node-gyp v3.0.3
Enclosed the cmd and the build output files
Got this error when run
npm install aws-iot-device-sdk
Node version: v4.1.2