1

I'm working on a Meteor app locally on OSX 10.9.5.

I'm getting this error:

 dyld: lazy symbol binding failed: Symbol not found: _node_module_register

I believe it has something to do with the zmq package. More on from the error:

Referenced from: /Users/user/node_modules/zmq/build/Release/zmq.node

I've tried:

Possible problems I'd rather not test unless absolutely necessary (as it requires full upgrade. I'm on an older computer.):

Warning: Error: dyld: lazy symbol binding failed: Symbol not found: _objc_autoreleasePoolPush

Git > dyld: lazy symbol binding failed: Symbol not found: _iconv_open

A zmq compiled under a newer version of OSX? (I'm using 10.9.5. Upgrading isn't a viable option unless absolutely necessary.)

If this is the problem....

Handling "dyld: lazy symbol binding failed: Symbol not found" error when nm does not find symbol

...How would I statically link the library to zmq???

The full error:

=> App running at: http://localhost:3000/
W20151202-10:02:42.764(2)? (STDERR) dyld: lazy symbol binding failed: Symbol not found: _node_module_register
W20151202-10:02:42.766(2)? (STDERR)   Referenced from: /Users/user/node_modules/zmq/build/Release/zmq.node
W20151202-10:02:42.766(2)? (STDERR)   Expected in: dynamic lookup
W20151202-10:02:42.766(2)? (STDERR) 
W20151202-10:02:42.767(2)? (STDERR) dyld: Symbol not found: _node_module_register
W20151202-10:02:42.767(2)? (STDERR)   Referenced from: /Users/user/node_modules/zmq/build/Release/zmq.node
W20151202-10:02:42.767(2)? (STDERR)   Expected in: dynamic lookup
W20151202-10:02:42.767(2)? (STDERR) 
=> Exited from signal: SIGTRAP

I've been trying to solve this for over a day now. Any help would be appreciated.

Community
  • 1
  • 1
Emily
  • 2,129
  • 3
  • 18
  • 43
  • Could it be that you have multiple versions of Node installed and running the install as root and the app as a normal user (or vice versa)? – robertklep Dec 02 '15 at 09:48
  • I tested running the app with sudo meteor. Which I believe should run it as the root. I'm still getting the same error. How would I check the reverse? I believe meteor loads nodjs?? So meteor would load nodjs as the root with sudo meteor to start the app??? – Emily Dec 02 '15 at 10:54
  • You need to make sure that the `zmq` module is built using the Node.js that is provided by Meteor (which I believe is shipped with Meteor, it doesn't use a separately installed Node.js). I also don't know about how well Node packages integrate with Meteor nowadays (it used to be pretty difficult, although I never used Meteor myself so I might be lying...). Alternatively, since Meteor is using Node v0.10.40, it may work if you installed that particular version of Node to try and build `zmq`. – robertklep Dec 02 '15 at 11:35
  • To test this, I went ahead and uninstalled nodjs & meteor completely. I re-installed both. Then started with a clean app. Before doing anything else, I used npm install zmq. I then added the problematic code "var zeromq = Npm.require('zmq');" to be executed on startup. I'm getting the exact same error as before. – Emily Dec 02 '15 at 15:05
  • Would this test rule out that zmq build and the meteor build are the same? – Emily Dec 02 '15 at 15:07
  • Within the Meteor distribution there are `node` and `npm` executables. Try using those (particularly `npm`) to install `zmq`, instead of a separate Node installation. – robertklep Dec 02 '15 at 15:09
  • From a freshly created Meteor app, within the application directory I enter 'npm install zmq'. I'm assuming that is using the nodejs within the app directory? If so, it's still giving me the same error. Any other ideas? – Emily Dec 02 '15 at 15:59
  • No, that wouldn't necessarily use Meteor's node/npm. What does `which npm` return while you're in such a directory? – robertklep Dec 02 '15 at 18:38
  • It returns, /usr/local/bin/npm. How would I constrain npm install zmq to us the local app version to install? (Sorry for the newbie question here.) – Emily Dec 02 '15 at 19:31
  • I downloaded the latest Meteor installer, and added some instructions for you to try [in this gist](https://gist.github.com/robertklep/3d89076ef298dcdc2e1a). – robertklep Dec 02 '15 at 19:44
  • OMG it worked!!!!!! Thank you, thank you, thank you. – Emily Dec 03 '15 at 08:36

3 Answers3

4

I was able to fix this by removing the node_modules folder and then run

$ meteor npm install
robodo
  • 430
  • 3
  • 8
1

My understanding of this error is that there is a mismatch between node versions used to install/run node.js code.

I had this issue because I npm installed with node 5, but my run config was node 0.11.something.

I switched my run config to use node 5, and the problem went away.

Matthew Beck
  • 451
  • 5
  • 19
  • This fixed it for me as well. Had to switch from Node v10 to Node v12 and the error disappeared. – FK82 Sep 20 '20 at 18:04
0

(recap of the comments, for others that are interested; since I don't have any hands-on Meteor experience, my solution may be wrong, in which case, feel free to correct me :)

Meteor comes with its own set of node and npm executables. If you want to use Node modules that depend on addons, like zmq, you need to make sure that these modules are installed with the Meteor-supplied executables; otherwise, you may run into issues (although it may work if you install the same version of Node that Meteor uses, which seem to be node@0.10.40 and npm@1.4.28, although I don't know if the Meteor executables are "plain" Node/npm or if they are patched).

The executables can be found within the .meteor directory. In case of OS X, they are located in ~/.meteor/packages/meteor-tool/1.1.10/mt-os.osx.x86_64/dev_bundle/bin/ (although the version number may vary, I suppose).

An easy way for making sure that the Meteor executables are used instead of a globally installed Node/npm, you can add that directory to the start of your $PATH:

$ export PATH=~/.meteor/packages/meteor-tool/1.1.10/mt-os.osx.x86_64/dev_bundle/bin/:$PATH

After that, in the same shell session, both node and npm should now point to the Meteor-supplied versions and you can install addons using them:

$ npm install zmq
robertklep
  • 198,204
  • 35
  • 394
  • 381