Skip to content
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

Module did not self-register on node 8.1.3 #952

Closed
rm3nchaca opened this issue Sep 19, 2017 · 10 comments
Closed

Module did not self-register on node 8.1.3 #952

rm3nchaca opened this issue Sep 19, 2017 · 10 comments
Labels

Comments

@rm3nchaca
Copy link

I'm getting the following error:

module.js:598
return process.dlopen(module, path._makeLong(filename));
^

Error: Module did not self-register.
at Object.Module._extensions..node (module.js:598:18)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object. (SOME_PATH/node_modules/sharp/lib/constructor.js:9:15)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)

There is no problem in node 6.x.
I've tried with npm rebuild, and also a clean install, and the problem persists.

Any clues???
Thanks!

@lovell
Copy link
Owner

lovell commented Sep 19, 2017

Hello, the "Module did not self-register" message usually suggests either different versions of node are being used at npm install time and run time, or different platforms/architectures are being used, e.g. 32-bit vs 64-bit.

@rm3nchaca
Copy link
Author

Thanks for you fast response!
I know, but I tried a rebuild, and a clean install and the problem persisted.
Then I switch back to a 6.x version and run again a rebuild and worked.
Then I switch to a 8.1.3 version and show me the errors related to different versions.
Finally with an npm rebuild I got the self register error.
Also, with a fresh install..
I'm using fedora, I'm going to dig more with this, maybe is something in my environment.
Any help is appreciated!
Thanks!

@lovell
Copy link
Owner

lovell commented Sep 19, 2017

If you've not already tried it, readelf might provide some help when debugging the shared library that is being built.

$ readelf -h SOME_PATH/node_modules/sharp/build/Release/sharp.node

@lovell
Copy link
Owner

lovell commented Oct 30, 2017

Closing due to inactivity but please feel free to re-open if the original problem persists.

@lovell lovell closed this as completed Oct 30, 2017
@brollb
Copy link

brollb commented Nov 3, 2017

I have been seeing this same issue with node version v6.9.2 and node 8.9.0. I tried clearing the cache and reinstalling the node modules but it didn't seem to resolve the issue...

rm -rf node_modules
npm cache clean --force
npm install

but I am still getting the error:

 Could not load sharp: Error: Module did not self-register.
    at Object.Module._extensions..node (module.js:664:18)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/brian/projects/netsblox/netsblox/node_modules/sharp/lib/constructor.js:9:15)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/brian/projects/netsblox/netsblox/node_modules/sharp/lib/index.js:3:15)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)

@lovell
Copy link
Owner

lovell commented Nov 3, 2017

@brollb Please make certain that the same major version of node is being used for npm install and at runtime. For example, could there be conflicting node versions on this machine (you do mention this)?

Could there be a slightly broken global installation of libvips on this machine? What does the suggested readelf command above produce?

@ghost
Copy link

ghost commented Jan 9, 2018

I am having this issue to, when I try to run the readelf command, it says it's not found. The reason I had to switch node versions was because sharp wasn't compiled for the latest. I've removed the node_modules folder several times with no prevail, and using nvm i made sure that I was on the node version that supported NODE_MODULES 51 (node 7.10.1).

Any luck? Spent hours trying to get this package to work...

@lovell
Copy link
Owner

lovell commented Jan 9, 2018

@JordanMaxFCB A value of 51 for NODE_MODULE_VERSION means there's probably an old version of the unsupported Node 7 somewhere on your machine that is taking priority over anything that nvm is using.

@ghost
Copy link

ghost commented Jan 9, 2018

@lovell So what would you recommend to resolving that? I'm not a Node developer, and I do use Node to develop React Native on my own time (this is a work computer), is there a way to check if other node versions exist? Also what would happen if a user wanted to use this library, and had another package with a different node that compiled that? Off-topic, but I can't seem to grasp how Javascript developers do that (I do .NET primarily). But really just wondering if there's a way to check if other nodejs exists on my computer (what you were saying) and how to fix that?

@iliaskarim
Copy link

If you've not already tried it, readelf might provide some help when debugging the shared library that is being built.

$ readelf -h SOME_PATH/node_modules/sharp/build/Release/sharp.node

it's not an ELF but a " Mach-O 64-bit bundle x86_64" "sharp@npm:^0.23.0"

Repository owner locked and limited conversation to collaborators Sep 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants