New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined symbol: node_module_register #1477

Closed
nodesocket opened this Issue Jul 28, 2015 · 6 comments

Comments

3 participants
@nodesocket

nodesocket commented Jul 28, 2015

When we turn on cluster support instances: 0 with our application we are getting:

 Error: app/node_modules/bcrypt/build/Release/bcrypt_lib.node: undefined symbol: node_module_register

If we go back to fork and no instances, it works fine.

Running v0.12.6 via nvm.

@nodesocket

This comment has been minimized.

Show comment
Hide comment
@nodesocket

nodesocket Jul 28, 2015

We fixed it.

nodesocket commented Jul 28, 2015

We fixed it.

@nodesocket nodesocket closed this Jul 28, 2015

@sjanahan

This comment has been minimized.

Show comment
Hide comment
@sjanahan

sjanahan Jul 31, 2015

How did you fix this? I am getting a similar error when including bcrypt 0.8.4.
OS: Ubuntu 12.04 64 bit
node version: v.12

I have tried removing the node modules and reinstalling them to hopefully recompile bcrypt with the appropriate node version. I know node_module_register was added in v.11 somewhere.

sjanahan commented Jul 31, 2015

How did you fix this? I am getting a similar error when including bcrypt 0.8.4.
OS: Ubuntu 12.04 64 bit
node version: v.12

I have tried removing the node modules and reinstalling them to hopefully recompile bcrypt with the appropriate node version. I know node_module_register was added in v.11 somewhere.

@nodesocket

This comment has been minimized.

Show comment
Hide comment
@nodesocket

nodesocket Jul 31, 2015

For us, it was because we installed node 0.10.x a long time ago globally /usr/local/bin and then setup NVM after. While our app was using the NVM version 0.12.x npm install was actually using the globally installed version in /usr/local/bin.

The solution, was to delete all references to node in /usr/loca/bin and only use NVM. Then do npm install again.

Hope that helps.

nodesocket commented Jul 31, 2015

For us, it was because we installed node 0.10.x a long time ago globally /usr/local/bin and then setup NVM after. While our app was using the NVM version 0.12.x npm install was actually using the globally installed version in /usr/local/bin.

The solution, was to delete all references to node in /usr/loca/bin and only use NVM. Then do npm install again.

Hope that helps.

@soyuka

This comment has been minimized.

Show comment
Hide comment
@soyuka

soyuka Jul 31, 2015

Collaborator

npm rebuild can also re-compile packages (faster than npm i).

Collaborator

soyuka commented Jul 31, 2015

npm rebuild can also re-compile packages (faster than npm i).

@sjanahan

This comment has been minimized.

Show comment
Hide comment
@sjanahan

sjanahan Jul 31, 2015

Thanks for the quick response.

I did a whereis node and got four different locations. All of them appear to be v 0.12. This issue only happens when you try to compile bcrypt with node v.10. Is there any way that you know of to find any older versions of node?

I searched the following places:
/usr/bin/node
/usr/bin/X11/node
/usr/local/bin/node
/usr/share/man/man1/node.1.gz

Another thing that's weird is that if I run node interactively, and I require bcrypt, it works fine.
janahan@janahan-System-Product-Name:~/Documents/anomalyfinder/web/quotail/node_modules/bcrypt$ node

require ('bcrypt');
{ genSaltSync: [Function],
genSalt: [Function],
hashSync: [Function],
hash: [Function],
compareSync: [Function],
compare: [Function],
getRounds: [Function] }

If I require bcrypt in any kind of .js script, I get the dreaded:
/home/janahan/Documents/anomalyfinder/web/quotail/node_modules/bcrypt/node_modules/bindings/bindings.js:83
throw e
^
Error: /home/janahan/Documents/anomalyfinder/web/quotail/node_modules/bcrypt/build/Release/bcrypt_lib.node: undefined symbol: node_module_register
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at bindings (/home/janahan/Documents/anomalyfinder/web/quotail/node_modules/bcrypt/node_modules/bindings/bindings.js:76:44)
at Object. (/home/janahan/Documents/anomalyfinder/web/quotail/node_modules/bcrypt/bcrypt.js:3:35)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/home/janahan/Documents/anomalyfinder/web/quotail/pg_models/user.js:1:76)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)

Any other tips you may have?

sjanahan commented Jul 31, 2015

Thanks for the quick response.

I did a whereis node and got four different locations. All of them appear to be v 0.12. This issue only happens when you try to compile bcrypt with node v.10. Is there any way that you know of to find any older versions of node?

I searched the following places:
/usr/bin/node
/usr/bin/X11/node
/usr/local/bin/node
/usr/share/man/man1/node.1.gz

Another thing that's weird is that if I run node interactively, and I require bcrypt, it works fine.
janahan@janahan-System-Product-Name:~/Documents/anomalyfinder/web/quotail/node_modules/bcrypt$ node

require ('bcrypt');
{ genSaltSync: [Function],
genSalt: [Function],
hashSync: [Function],
hash: [Function],
compareSync: [Function],
compare: [Function],
getRounds: [Function] }

If I require bcrypt in any kind of .js script, I get the dreaded:
/home/janahan/Documents/anomalyfinder/web/quotail/node_modules/bcrypt/node_modules/bindings/bindings.js:83
throw e
^
Error: /home/janahan/Documents/anomalyfinder/web/quotail/node_modules/bcrypt/build/Release/bcrypt_lib.node: undefined symbol: node_module_register
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at bindings (/home/janahan/Documents/anomalyfinder/web/quotail/node_modules/bcrypt/node_modules/bindings/bindings.js:76:44)
at Object. (/home/janahan/Documents/anomalyfinder/web/quotail/node_modules/bcrypt/bcrypt.js:3:35)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/home/janahan/Documents/anomalyfinder/web/quotail/pg_models/user.js:1:76)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)

Any other tips you may have?

@sjanahan

This comment has been minimized.

Show comment
Hide comment
@sjanahan

sjanahan Jul 31, 2015

I figured it out. I had a version of NODEJS that was v .10. Now everything seems to be fine. Thank you!

The ones located at the following were not the correct versions:
/usr/bin/node
/usr/bin/X11/node
/usr/share/man/man1/node.1.gz

sjanahan commented Jul 31, 2015

I figured it out. I had a version of NODEJS that was v .10. Now everything seems to be fine. Thank you!

The ones located at the following were not the correct versions:
/usr/bin/node
/usr/bin/X11/node
/usr/share/man/man1/node.1.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment