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 #19

Closed
niftylettuce opened this issue Aug 13, 2020 · 19 comments · Fixed by #20
Closed

Module did not self-register #19

niftylettuce opened this issue Aug 13, 2020 · 19 comments · Fixed by #20

Comments

@niftylettuce
Copy link
Contributor

niftylettuce commented Aug 13, 2020

Full stack trace:

Module did not self-register: '/var/www/production/source/node_modules/node-snowball/build/Release/snowball.node'.
Error: Module did not self-register: '/var/www/production/source/node_modules/node-snowball/build/Release/snowball.node'.
   at Object.Module._extensions..node (internal/modules/cjs/loader.js:1188:18)
   at Module.load (internal/modules/cjs/loader.js:986:32)
   at Function.Module._load (internal/modules/cjs/loader.js:879:14)
   at Module.require (internal/modules/cjs/loader.js:1026:19)
   at require (internal/modules/cjs/helpers.js:72:18)
   at Object.<anonymous> (/var/www/production/source/node_modules/node-snowball/index.js:1:16)
   at Module._compile (internal/modules/cjs/loader.js:1138:30)
   at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
   at Module.load (internal/modules/cjs/loader.js:986:32)
   at Function.Module._load (internal/modules/cjs/loader.js:879:14)
   at Module.require (internal/modules/cjs/loader.js:1026:19)
   at require (internal/modules/cjs/helpers.js:72:18)
   at Object.<anonymous> (/var/www/production/source/node_modules/spamscanner/index.js:38:18)
   at Module._compile (internal/modules/cjs/loader.js:1138:30)
   at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
   at Module.load (internal/modules/cjs/loader.js:986:32)
   at Function.Module._load (internal/modules/cjs/loader.js:879:14)
   at Module.require (internal/modules/cjs/loader.js:1026:19)
   at require (internal/modules/cjs/helpers.js:72:18)
   at Object.<anonymous> (/var/www/production/source/node_modules/forward-email/index.js:11:21)
   at Module._compile (internal/modules/cjs/loader.js:1138:30)
   at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
@niftylettuce
Copy link
Contributor Author

Using latest Node.js v12 LTS and installing with npm.

@rm-hull
Copy link
Collaborator

rm-hull commented Aug 13, 2020

Which OS ?

@niftylettuce
Copy link
Contributor Author

Ubuntu 18.04 LTS

@niftylettuce
Copy link
Contributor Author

Does this help? https://stackoverflow.com/a/46935984

@niftylettuce
Copy link
Contributor Author

Trying the rebuild method now..

@niftylettuce
Copy link
Contributor Author

That did not work. I also reproduced this issue on macOS just now!

✖  error     Error: Module did not self-register: '/Users/user/Projects/forwardemail.net/node_modules/node-snowball/build/Release/snowball.node'.
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1188:18)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/Users/user/Projects/forwardemail.net/node_modules/node-snowball/index.js:1:16)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/Users/user/Projects/forwardemail.net/node_modules/spamscanner/index.js:38:18)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/Users/user/Projects/forwardemail.net/node_modules/forward-email/index.js:11:21)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)

@niftylettuce
Copy link
Contributor Author

I think we need to swap this order, testing now:

            "sources": [
                "src/snowball.cpp",
                "src/NativeExtension.cpp",

@niftylettuce
Copy link
Contributor Author

That didn't fix it, per StackOverflow suggestion...

@niftylettuce
Copy link
Contributor Author

Actually, I may have needed to run npm rebuild after changing the order, testing again!

@niftylettuce
Copy link
Contributor Author

That didn't work 😢

@rm-hull
Copy link
Collaborator

rm-hull commented Aug 14, 2020

The build runs on a weekly crown job in travis, and I just ran a rebuild which has completed ok, see https://travis-ci.org/github/hthetiot/node-snowball/builds

Let me try it on one of the projects I have used it on...

What version of npm and gcc are you using?

@niftylettuce
Copy link
Contributor Author

~/Projects/forward-email master*
❯ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

~/Projects/forward-email master*
❯ node --version
v12.18.0

@niftylettuce
Copy link
Contributor Author

I think the issue is when this package is a package used in a package, or one two or three levels deep.

@niftylettuce
Copy link
Contributor Author

That's not it. I still get the error.

@niftylettuce
Copy link
Contributor Author

This happens on both macOS and also on a fresh Ubuntu 18.04 LTS server. This isn't on my side.

@niftylettuce
Copy link
Contributor Author

Actually, I wonder if it's happening because it's being spawned from a Node.js worker thread.... that might be it.

@niftylettuce
Copy link
Contributor Author

A-ha!!! It is. This is the issue. nodejs/node#21783 (comment)

@niftylettuce
Copy link
Contributor Author

PR inbound

@niftylettuce
Copy link
Contributor Author

@rm-hull feel free to merge #20 and release 🎉

rm-hull pushed a commit that referenced this issue Aug 14, 2020
niftylettuce added a commit to spamscanner/spamscanner that referenced this issue Aug 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants