node-airplay icon indicating copy to clipboard operation
node-airplay copied to clipboard

Module version mismatch. Expected 13, got 11.

Open SebCorbin opened this issue 11 years ago • 7 comments

Trying to use this library i've got this from file node_modules/airplay2/node_modules/mdns/lib/dns_sd.js

SebCorbin avatar Mar 11 '14 21:03 SebCorbin

Can you provide more description ?

zfkun avatar Mar 14 '14 05:03 zfkun

Sure, basically all I do is require('airplay2') but there seems to be a dependency problem with mdns.

When I do npm install airplay2, I get

npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] url is also the name of a node core module.
npm http GET https://registry.npmjs.org/airplay2
npm http 304 https://registry.npmjs.org/airplay2
npm http GET https://github.com/zfkun/node_mdns/tarball/master
npm http GET https://registry.npmjs.org/plist
npm http 304 https://registry.npmjs.org/plist
npm http 200 https://github.com/zfkun/node_mdns/tarball/master
npm WARN excluding symbolic link utils/ncov -> lib/ncov.js

> [email protected] install /Users/sebcorbin/Sites/popcorn-app/node_modules/airplay2/node_modules/mdns
> node-gyp rebuild

  CXX(target) Release/obj.target/dns_sd_bindings/src/dns_sd.o
  CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_browse.o
  CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_enumerate_domains.o
  CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_get_addr_info.o
  CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_process_result.o
  CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_ref.o
  CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_ref_deallocate.o
  CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_ref_sock_fd.o
  CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_register.o
  CXX(target) Release/obj.target/dns_sd_bindings/src/dns_service_resolve.o
  CXX(target) Release/obj.target/dns_sd_bindings/src/mdns_utils.o
  CXX(target) Release/obj.target/dns_sd_bindings/src/network_interface.o
  CXX(target) Release/obj.target/dns_sd_bindings/src/socket_watcher.o
  CXX(target) Release/obj.target/dns_sd_bindings/src/txt_record_ref.o
  CXX(target) Release/obj.target/dns_sd_bindings/src/txt_record_create.o
  CXX(target) Release/obj.target/dns_sd_bindings/src/txt_record_deallocate.o
  CXX(target) Release/obj.target/dns_sd_bindings/src/txt_record_set_value.o
  CXX(target) Release/obj.target/dns_sd_bindings/src/txt_record_get_length.o
  CXX(target) Release/obj.target/dns_sd_bindings/src/txt_record_buffer_to_object.o
  SOLINK_MODULE(target) Release/dns_sd_bindings.node
  SOLINK_MODULE(target) Release/dns_sd_bindings.node: Finished
npm http GET https://registry.npmjs.org/xmlbuilder
npm http GET https://registry.npmjs.org/xmldom
npm http 304 https://registry.npmjs.org/xmldom
npm http 304 https://registry.npmjs.org/xmlbuilder
[email protected] node_modules/airplay2
├── [email protected] ([email protected], [email protected])
└── [email protected]`

Then in my app I get this error :

Uncaught node.js Error 

Error: dlopen(/Users/sebcorbin/Sites/popcorn-app/build/releases/Popcorn-Time/mac/Popcorn-Time.app/Contents/Resources/app.nw/node_modules/airplay2/node_modules/mdns/build/Release/dns_sd_bindings.node, 1): no suitable image found.  Did find:
/Users/sebcorbin/Sites/popcorn-app/build/releases/Popcorn-Time/mac/Popcorn-Time.app/Contents/Resources/app.nw/node_modules/airplay2/node_modules/mdns/build/Release/dns_sd_bindings.node: mach-o, but wrong architecture
    at Module.load (module.js:352:32)
    at Function.Module._load (module.js:308:12)
    at Module.require (module.js:360:17)
    at require (module.js:376:17)
    at Object.eval (/Users/sebcorbin/Sites/popcorn-app/build/releases/Popcorn-Time/mac/Popcorn-Time.app/Contents/Resources/app.nw/node_modules/airplay2/node_modules/mdns/lib/dns_sd.js:24:20)
    at Module._compile (module.js:452:26)
    at Object.Module._extensions..js (module.js:470:10)
    at Module.load (module.js:352:32)
    at Function.Module._load (module.js:308:12)
    at Module.require (module.js:360:17)

I read here https://groups.google.com/d/msg/node-webkit/cfHrfHJRzaM/mZ06QxY6MlAJ that it is an architecture problem so I do export npm_config_arch=ia32 and redo npm install airplay2 and relaunch the app and then I get

Uncaught node.js Error 

Error: Module version mismatch. Expected 13, got 11.
    at Module.load (module.js:352:32)
    at Function.Module._load (module.js:308:12)
    at Module.require (module.js:360:17)
    at require (module.js:376:17)
    at Object.eval (/Users/sebcorbin/Sites/popcorn-app/build/releases/Popcorn-Time/mac/Popcorn-Time.app/Contents/Resources/app.nw/node_modules/airplay2/node_modules/mdns/lib/dns_sd.js:24:20)
    at Module._compile (module.js:452:26)
    at Object.Module._extensions..js (module.js:470:10)
    at Module.load (module.js:352:32)
    at Function.Module._load (module.js:308:12)
    at Module.require (module.js:360:17)

SebCorbin avatar Mar 14 '14 08:03 SebCorbin

may be, your node or node-gyp version is old ?

on my mac:

zfkun avatar May 03 '14 10:05 zfkun

OK so I found the problem (but not the solution), airplay2 works in command line, but not under node-webkit. It seems that node-webkit runs 32bits, but airplay2/mdns is compiled in 64bits

SebCorbin avatar May 15 '14 09:05 SebCorbin

oh, i know ~

if you want use airplay2 in node-webkit, you must rebuild mdns module with nw-gyp.

cd node_modules/airplay2/node_modules/mdns && nw-gyp rebuild --target=0.8.6

example in package.json: https://github.com/zfkun/iplay/blob/master/package.json#L28

zfkun avatar May 19 '14 17:05 zfkun

That doesn't work for me for some reason. It still throws the same error. Any advice?

fwachs avatar May 22 '14 20:05 fwachs

Yep, I got it again

SebCorbin avatar May 31 '14 09:05 SebCorbin