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

Hello World throws "Module did not self-register" with iojs (1.4.3) on Windows 8 x64 #22

Closed
pgbross opened this issue Mar 6, 2015 · 1 comment

Comments

@pgbross
Copy link

pgbross commented Mar 6, 2015

The hello world example works for me with node 0.12, but fails with iojs 1.4.3 on Windows 8 x64.
I removed node 0.12 and verified nodejs folder was completely removed from Program Files. I then installed iojs 1.4.3 and get the following in a shell window on asking the versions.

$ node -v
v1.4.3

$ npm -v
2.6.1

I ran npm cache clean, and deleted any old .node_gyp folders in my profile to ensure there were no remnants of node 0.12. I then updated 'nan' to the latest version by npm uninstall --save nan, npm install --save nan. There were no errors from nod_gyp, but on running npm test, I get the following error.

Error: Module did not self-register.
    at Error (native)
    at Module.load (module.js:339:32)
    at Function.Module._load (module.js:294:12)
    at Module.require (module.js:349:17)
    at require (module.js:368:17)
    at bindings (C:\Users\philip\Desktop\node-addon-examples\1_hello_world\nan\node_modules\bindings\bindings.s:76:44)
    at Object.<anonymous> (C:\Users\philip\Desktop\node-addon-examples\1_hello_world\nan\hello.js:1:94)
    at Module._compile (module.js:444:26)
    at Object.Module._extensions..js (module.js:462:10)
    at Module.load (module.js:339:32)
npm ERR! Test failed.  See above for more details.

When this failed with "nan", I then tried the node_0.12 folder version that doesn't use the nan macros, but it shows the same behaviour.

Should the Hello World example work with iojs on WIndows x64, or have I perhas got some setting or old version of a library lurking not cleared?

thanks,
--philip

@pgbross
Copy link
Author

pgbross commented Mar 8, 2015

After reading about similar issues in the iojs issue list (io.js/issues/965), it appears that, at least in iojs 1.4.3, that c++ extensions only work if started from an executable called "iojs.exe". If you rename the executable or have links to it, such as a hardlink to node.exe, then you get the behaviour reported above.

So there is no issue in the hello world example, as it appears to be a behaviour of the current builds of iojs and node. (for completeness I confirmed that with node 0.12 i get the same behaviour - renaming the executable exhibits prevents binary/c++ modules loading).

thanks,
--philip

@pgbross pgbross closed this as completed Mar 8, 2015
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

No branches or pull requests

1 participant