camme / node-nfc

A first try at binding libnfc to node. This project is right now not good enough to use.
68 stars 39 forks source link

Unable to install #11

Closed magic890 closed 8 years ago

magic890 commented 9 years ago

I got this error trying to installing the module with npm install nfc.

Error:

\
> nfc@0.0.5 install /Users/magic890/Sites/test-rfid/node-nfc/node_modules/nfc
> node-gyp rebuild

  CXX(target) Release/obj.target/nfc/src/nfc.o
../src/nfc.cc:13:18: error: unknown type name 'uv_work_t'
    void NFCRead(uv_work_t* req);
                 ^
../src/nfc.cc:14:23: error: unknown type name 'uv_work_t'
    void AfterNFCRead(uv_work_t* req);
                      ^
../src/nfc.cc:16:17: error: expected class name
    struct NFC: ObjectWrap {
                ^
../src/nfc.cc:17:40: error: unknown type name 'Arguments'; did you mean
      'v8::internal::Arguments'?
        static Handle<Value> New(const Arguments& args);
                                       ^~~~~~~~~
                                       v8::internal::Arguments
/Users/magic890/.node-gyp/0.12.2/deps/v8/include/v8.h:127:7: note:
      'v8::internal::Arguments' declared here
class Arguments;
      ^
../src/nfc.cc:18:42: error: unknown type name 'Arguments'; did you mean
      'v8::internal::Arguments'?
        static Handle<Value> Start(const Arguments& args);
                                         ^~~~~~~~~
                                         v8::internal::Arguments
/Users/magic890/.node-gyp/0.12.2/deps/v8/include/v8.h:127:7: note:
      'v8::internal::Arguments' declared here
class Arguments;
      ^
../src/nfc.cc:21:34: error: unknown type name 'Arguments'; did you mean
      'v8::internal::Arguments'?
    Handle<Value> NFC::New(const Arguments& args) {
                                 ^~~~~~~~~
                                 v8::internal::Arguments
/Users/magic890/.node-gyp/0.12.2/deps/v8/include/v8.h:127:7: note:
      'v8::internal::Arguments' declared here
class Arguments;
      ^
../src/nfc.cc:22:21: error: calling a protected constructor of class
      'v8::HandleScope'
        HandleScope scope;
                    ^
/Users/magic890/.node-gyp/0.12.2/deps/v8/include/v8.h:816:13: note: declared
      protected here
  V8_INLINE HandleScope() {}
            ^
../src/nfc.cc:23:20: error: member access into incomplete type 'const
      v8::internal::Arguments'
        assert(args.IsConstructCall());
                   ^
/usr/include/assert.h:93:25: note: expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE...
                        ^
/Users/magic890/.node-gyp/0.12.2/deps/v8/include/v8.h:127:7: note: forward
      declaration of 'v8::internal::Arguments'
class Arguments;
      ^
../src/nfc.cc:25:15: error: no member named 'Wrap' in '(anonymous
      namespace)::NFC'
        self->Wrap(args.This());
        ~~~~  ^
../src/nfc.cc:25:24: error: member access into incomplete type 'const
      v8::internal::Arguments'
        self->Wrap(args.This());
                       ^
/Users/magic890/.node-gyp/0.12.2/deps/v8/include/v8.h:127:7: note: forward
      declaration of 'v8::internal::Arguments'
class Arguments;
      ^
../src/nfc.cc:26:22: error: no member named 'Close' in 'v8::HandleScope'
        return scope.Close(args.This());
               ~~~~~ ^
../src/nfc.cc:26:32: error: member access into incomplete type 'const
      v8::internal::Arguments'
        return scope.Close(args.This());
                               ^
/Users/magic890/.node-gyp/0.12.2/deps/v8/include/v8.h:127:7: note: forward
      declaration of 'v8::internal::Arguments'
class Arguments;
      ^
../src/nfc.cc:37:36: error: unknown type name 'Arguments'; did you mean
      'v8::internal::Arguments'?
    Handle<Value> NFC::Start(const Arguments& args) {
                                   ^~~~~~~~~
                                   v8::internal::Arguments
/Users/magic890/.node-gyp/0.12.2/deps/v8/include/v8.h:127:7: note:
      'v8::internal::Arguments' declared here
class Arguments;
      ^
../src/nfc.cc:39:21: error: calling a protected constructor of class
      'v8::HandleScope'
        HandleScope scope;
                    ^
/Users/magic890/.node-gyp/0.12.2/deps/v8/include/v8.h:816:13: note: declared
      protected here
  V8_INLINE HandleScope() {}
            ^
../src/nfc.cc:54:58: error: member access into incomplete type 'const
      v8::internal::Arguments'
        Handle<Function> cb = Handle<Function>::Cast(args.This());
                                                         ^
/Users/magic890/.node-gyp/0.12.2/deps/v8/include/v8.h:127:7: note: forward
      declaration of 'v8::internal::Arguments'
class Arguments;
      ^
../src/nfc.cc:56:49: error: 'New' is a private member of
      'v8::PersistentBase<v8::Function>'
        baton->callback = Persistent<Function>::New(cb);
                                                ^
/Users/magic890/.node-gyp/0.12.2/deps/v8/include/v8.h:572:23: note: declared
      private here
  V8_INLINE static T* New(Isolate* isolate, T* that);
                      ^
../src/nfc.cc:56:27: error: too few arguments to function call, expected 2, have
      1; did you mean '::NFC::New'?
        baton->callback = Persistent<Function>::New(cb);
                          ^~~~~~~~~~
                          ::NFC::New
../src/nfc.cc:21:24: note: '::NFC::New' declared here
    Handle<Value> NFC::New(const Arguments& args) {
                       ^
../src/nfc.cc:69:9: error: unknown type name 'uv_work_t'
        uv_work_t *req = new uv_work_t();
        ^
../src/nfc.cc:69:30: error: unknown type name 'uv_work_t'
        uv_work_t *req = new uv_work_t();
                             ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Release/obj.target/nfc/src/nfc.o] Error 1
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:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Darwin 14.4.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/magic890/Sites/test-rfid/node-nfc/node_modules/nfc
gyp ERR! node -v v0.12.2
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
npm ERR! Darwin 14.4.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "nfc"
npm ERR! node v0.12.2
npm ERR! npm  v2.9.1
npm ERR! code ELIFECYCLE

npm ERR! nfc@0.0.5 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nfc@0.0.5 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the nfc 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 nfc
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/magic890/Sites/test-rfid/node-nfc/npm-debug.log

npm-debug.log:

0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'install', 'nfc' ]
2 info using npm@2.9.1
3 info using node@v0.12.2
4 verbose install initial load of /Users/magic890/Sites/test-rfid/node-nfc/package.json
5 verbose readDependencies loading dependencies from /Users/magic890/Sites/test-rfid/node-nfc/package.json
6 silly cache add args [ 'nfc', null ]
7 verbose cache add spec nfc
8 silly cache add parsed spec { raw: 'nfc',
8 silly cache add   scope: null,
8 silly cache add   name: 'nfc',
8 silly cache add   rawSpec: '',
8 silly cache add   spec: '*',
8 silly cache add   type: 'range' }
9 silly addNamed nfc@*
10 verbose addNamed "*" is a valid semver range for nfc
11 silly addNameRange { name: 'nfc', range: '*', hasData: false }
12 silly mapToRegistry name nfc
13 silly mapToRegistry using default registry
14 silly mapToRegistry registry https://registry.npmjs.org/
15 silly mapToRegistry uri https://registry.npmjs.org/nfc
16 verbose addNameRange registry:https://registry.npmjs.org/nfc not in flight; fetching
17 verbose request uri https://registry.npmjs.org/nfc
18 verbose request no auth needed
19 info attempt registry request try #1 at 4:23:49 PM
20 verbose request id 0f9542d453f513e5
21 verbose etag "EK0NCH7U4O7PT9XZI0I9HA3YQ"
22 http request GET https://registry.npmjs.org/nfc
23 http 304 https://registry.npmjs.org/nfc
24 silly get cb [ 304,
24 silly get   { date: 'Mon, 15 Jun 2015 14:23:49 GMT',
24 silly get     via: '1.1 varnish',
24 silly get     'cache-control': 'max-age=60',
24 silly get     etag: '"EK0NCH7U4O7PT9XZI0I9HA3YQ"',
24 silly get     age: '0',
24 silly get     connection: 'keep-alive',
24 silly get     'x-served-by': 'cache-fra1231-FRA',
24 silly get     'x-cache': 'HIT',
24 silly get     'x-cache-hits': '1',
24 silly get     'x-timer': 'S1434378229.362440,VS0,VE99',
24 silly get     vary: 'Accept' } ]
25 verbose etag https://registry.npmjs.org/nfc from cache
26 verbose get saving nfc to /Users/magic890/.npm/registry.npmjs.org/nfc/.cache.json
27 silly addNameRange number 2 { name: 'nfc', range: '*', hasData: true }
28 silly addNameRange versions [ 'nfc', [ '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5' ] ]
29 silly addNamed nfc@0.0.5
30 verbose addNamed "0.0.5" is a plain semver version for nfc
31 silly cache afterAdd nfc@0.0.5
32 verbose afterAdd /Users/magic890/.npm/nfc/0.0.5/package/package.json not in flight; writing
33 verbose afterAdd /Users/magic890/.npm/nfc/0.0.5/package/package.json written
34 silly install resolved [ { name: 'nfc',
34 silly install resolved     version: '0.0.5',
34 silly install resolved     description: 'Node NFC functionallity through libnfc',
34 silly install resolved     main: 'index.js',
34 silly install resolved     scripts:
34 silly install resolved      { test: 'echo "Error: no test specified" && exit 1',
34 silly install resolved        install: 'node-gyp rebuild' },
34 silly install resolved     repository:
34 silly install resolved      { type: 'git',
34 silly install resolved        url: 'git+https://github.com/Camme/node-nfc.git' },
34 silly install resolved     keywords: [ 'nfc' ],
34 silly install resolved     author: { name: 'Camilo Tapia', email: 'camilo.tapia@gmail.com' },
34 silly install resolved     license: 'MIT',
34 silly install resolved     gypfile: true,
34 silly install resolved     bugs: { url: 'https://github.com/Camme/node-nfc/issues' },
34 silly install resolved     homepage: 'https://github.com/Camme/node-nfc',
34 silly install resolved     _id: 'nfc@0.0.5',
34 silly install resolved     dist:
34 silly install resolved      { shasum: '3167cc6b2e6e0b8679f7999f0ab9ba58b2240da0',
34 silly install resolved        tarball: 'http://registry.npmjs.org/nfc/-/nfc-0.0.5.tgz' },
34 silly install resolved     _from: 'nfc@*',
34 silly install resolved     _npmVersion: '1.4.3',
34 silly install resolved     _npmUser: { name: 'camilo.tapia', email: 'camilo.tapia@gmail.com' },
34 silly install resolved     maintainers: [ [Object], [Object] ],
34 silly install resolved     directories: {},
34 silly install resolved     _shasum: '3167cc6b2e6e0b8679f7999f0ab9ba58b2240da0',
34 silly install resolved     _resolved: 'https://registry.npmjs.org/nfc/-/nfc-0.0.5.tgz',
34 silly install resolved     readme: 'ERROR: No README data found!' } ]
35 info install nfc@0.0.5 into /Users/magic890/Sites/test-rfid/node-nfc
36 info installOne nfc@0.0.5
37 verbose installOne of nfc to /Users/magic890/Sites/test-rfid/node-nfc not in flight; installing
38 verbose lock using /Users/magic890/.npm/_locks/nfc-acf3b55abe2a0770.lock for /Users/magic890/Sites/test-rfid/node-nfc/node_modules/nfc
39 silly install write writing nfc 0.0.5 to /Users/magic890/Sites/test-rfid/node-nfc/node_modules/nfc
40 verbose unbuild node_modules/nfc
41 silly gentlyRm /Users/magic890/Sites/test-rfid/node-nfc/node_modules/nfc is being purged from base /Users/magic890/Sites/test-rfid/node-nfc
42 verbose gentlyRm don't care about contents; nuking /Users/magic890/Sites/test-rfid/node-nfc/node_modules/nfc
43 verbose tar unpack /Users/magic890/.npm/nfc/0.0.5/package.tgz
44 verbose tar unpacking to /Users/magic890/Sites/test-rfid/node-nfc/node_modules/nfc
45 silly gentlyRm /Users/magic890/Sites/test-rfid/node-nfc/node_modules/nfc is being purged
46 verbose gentlyRm don't care about contents; nuking /Users/magic890/Sites/test-rfid/node-nfc/node_modules/nfc
47 silly gunzTarPerm modes [ '755', '644' ]
48 silly gunzTarPerm extractEntry package.json
49 silly gunzTarPerm extractEntry .npmignore
50 silly gunzTarPerm extractEntry README.md
51 silly gunzTarPerm extractEntry index.js
52 silly gunzTarPerm extractEntry test.js
53 silly gunzTarPerm extractEntry binding.gyp
54 silly gunzTarPerm extractEntry src/nfc.cc
55 silly gunzTarPerm extractEntry temp.c
56 verbose write writing to /Users/magic890/Sites/test-rfid/node-nfc/node_modules/nfc/package.json
57 info preinstall nfc@0.0.5
58 verbose readDependencies loading dependencies from /Users/magic890/Sites/test-rfid/node-nfc/node_modules/nfc/package.json
59 verbose readDependencies loading dependencies from /Users/magic890/Sites/test-rfid/node-nfc/node_modules/nfc/package.json
60 silly install resolved []
61 verbose about to build /Users/magic890/Sites/test-rfid/node-nfc/node_modules/nfc
62 info build /Users/magic890/Sites/test-rfid/node-nfc/node_modules/nfc
63 info linkStuff nfc@0.0.5
64 silly linkStuff nfc@0.0.5 has /Users/magic890/Sites/test-rfid/node-nfc/node_modules as its parent node_modules
65 verbose linkBins nfc@0.0.5
66 verbose linkMans nfc@0.0.5
67 verbose rebuildBundles nfc@0.0.5
68 info install nfc@0.0.5
69 verbose unsafe-perm in lifecycle true
70 info nfc@0.0.5 Failed to exec install script
71 verbose unlock done using /Users/magic890/.npm/_locks/nfc-acf3b55abe2a0770.lock for /Users/magic890/Sites/test-rfid/node-nfc/node_modules/nfc
72 verbose stack Error: nfc@0.0.5 install: `node-gyp rebuild`
72 verbose stack Exit status 1
72 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:213:16)
72 verbose stack     at EventEmitter.emit (events.js:110:17)
72 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14)
72 verbose stack     at ChildProcess.emit (events.js:110:17)
72 verbose stack     at maybeClose (child_process.js:1015:16)
72 verbose stack     at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
73 verbose pkgid nfc@0.0.5
74 verbose cwd /Users/magic890/Sites/test-rfid/node-nfc
75 error Darwin 14.4.0
76 error argv "node" "/usr/local/bin/npm" "install" "nfc"
77 error node v0.12.2
78 error npm  v2.9.1
79 error code ELIFECYCLE
80 error nfc@0.0.5 install: `node-gyp rebuild`
80 error Exit status 1
81 error Failed at the nfc@0.0.5 install script 'node-gyp rebuild'.
81 error This is most likely a problem with the nfc package,
81 error not with npm itself.
81 error Tell the author that this fails on your system:
81 error     node-gyp rebuild
81 error You can get their info via:
81 error     npm owner ls nfc
81 error There is likely additional logging output above.
82 verbose exit [ 1, true ]
83 verbose unbuild node_modules/nfc
84 info preuninstall nfc@0.0.5
85 info uninstall nfc@0.0.5
86 verbose unbuild rmStuff nfc@0.0.5 from /Users/magic890/Sites/test-rfid/node-nfc/node_modules
87 info postuninstall nfc@0.0.5
88 silly gentlyRm /Users/magic890/Sites/test-rfid/node-nfc/node_modules/nfc is being purged from base /Users/magic890/Sites/test-rfid/node-nfc
89 verbose gentlyRm don't care about contents; nuking /Users/magic890/Sites/test-rfid/node-nfc/node_modules/nfc
90 silly vacuum-fs purging /Users/magic890/Sites/test-rfid/node-nfc/node_modules/nfc
91 silly vacuum-fs removing /Users/magic890/Sites/test-rfid/node-nfc/node_modules
92 silly vacuum-fs finished vacuuming up to /Users/magic890/Sites/test-rfid/node-nfc

How can I solve this problem?

lancehudson commented 9 years ago

I was able to get it to work by using node v0.10 instead of 12

WeeJeWel commented 9 years ago

+1 please add support for nodejs 0.12

95gabor commented 9 years ago

+1

jeroenvollenbrock commented 9 years ago

I've forked this repo and rewrote the core to add node native abstractions, my fork of this module should include 0.12 and 4.0 support: https://github.com/athombv/node-nfc

95gabor commented 9 years ago

@jeroenvollenbrock Thank you! It's working for me. :)

jeroenvollenbrock commented 8 years ago

Fixed in #12