Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

node.js

npm

I have tried reinstalling and rebuilding npm, but the problem still persists.

Initially, the problem is with the module mongodb: I don't have that package, so I installed mongodb using this command npm install mongodb.

It shows me the following error:
dyld: Symbol not found: _node_module_register

like image 653
Farid Blaster Avatar asked May 08 '15 18:05

Farid Blaster


3 Answers

Try deleting your node_modules folder and running npm install again.

rm -rf node_modules/
npm install

That should fix it.

like image 93
Ashish Avatar answered Sep 22 '22 06:09

Ashish


Basically this error means - some binary packages was built under different node.js versions and not compatible to each other.

  1. Via NVM make sure you are using proper version of node.js, run node -v;
  2. After installing and switching to proper node.js version via nvm run npm update;
  3. After all packages are updated (or downgraded) to compatible versions, run npm rebuild;
  4. Note: npm rebuild might throw errors - just run npm rebuild again and again until it runs successfully.

Note: some commands may ask for root (sudo) permissions, - it depends from how you have installed packages, npm and node itself previously. nvm - never needs to be run as root (sudo).

like image 20
dr.dimitru Avatar answered Sep 24 '22 06:09

dr.dimitru


If you just updated node and are running scripts via WebStorm, make sure you edit your Run/Debug Configurations and update the path to the Node Interpreter. I was using the node in

/usr/local/bin/node

, but after installing Node 4 using nvm, I need to use

/path/to/.nvm/v4.2.2/bin/node
like image 27
Thanh Nguyen Avatar answered Sep 24 '22 06:09

Thanh Nguyen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!