Skip to content

Unable to build and run C++ addon in Windows 8.1 x64 #965

Description

@metabench

I'm trying to use iojs 1.3.0 (Windows 8.1 x64), with a module written using nan, with nan 1.6.2 installed. It worked fine in node 0.12.0.

First I had problems with node-gyp looking for node.lib rather than iojs.lib. I got round that using pangyp.

When I tried running the JavaScript that references the addon, I got
Error: Module did not self-register.

I've found a reference to a similar seeming issue with node-sass here: sass/node-sass#708

Activity

  1. bnoordhuis commented on Feb 26, 2015

    @bnoordhuis
    Member

    Can you try using the npm / node-gyp that comes with io.js? The 'module did not self-register' error suggests that the module was built for the wrong version (probably node.js rather than io.js.)

  2. metabench commented on Feb 26, 2015

    @metabench
    Author

    I will try that soon. Currently I have both iojs and node uninstalled. I'll go get a sandwich, and then install iojs again. I'll try to use the versions of the tools that come with iojs and I'll report back how I get on.

  3. metabench commented on Feb 26, 2015

    @metabench
    Author

    No sandwich yet... but I've installed iojs, I think I am using the right tools, and ran into the same problem as before.

    This time I went to the C:\Program Files\iojs directory and ran
    npm install node-gyp -g. Maybe that is my problem as I may then be using the old (or current release) version of node-gyp to do the build. However, I don't know how to choose a specific node-gyp to use from the command line.

  4. metabench commented on Feb 26, 2015

    @metabench
    Author

    @bnoordhuis When I run "node-gyp -v" from either the iojs or my project's C++ path I get v1.0.2.

    As far as I know I'm not using the old version of node-gyp, but I don't know how to be sure about that. I don't know where to find the node-gyp that came with iojs.

  5. bnoordhuis commented on Feb 26, 2015

    @bnoordhuis
    Member

    @metabench v1.0.2 is the node-gyp version that ships with io.js. Can you tell what URL it downloads the source tarball from?

    BTW, the node-gyp script itself is pretty well hidden, it's in npm's node_modules/node-gyp/bin directory.

  6. metabench commented on Feb 26, 2015

    @metabench
    Author

    @bnoordhuis I'd like to tell you that, but I don't know when it downloads a source tarball, or when I see the URL.

  7. bnoordhuis commented on Feb 26, 2015

    @bnoordhuis
    Member

    It should be in npm-debug.log somewhere. You may have to remove the cache first. It's in $HOME/.node-gyp on Unices. I believe it's %USERPROFILE%\\.node-gyp on Windows.

  8. metabench commented on Feb 26, 2015

    @metabench
    Author

    @bnoordhuis I could not see any .log files within my user profile's .node-gyp directory (I searched for *.log). I just see: {'directories': ['deps', 'ia32', 'Release', 'src', 'tools', x64], 'files': ['comon.gypi', 'installVersion']}

  9. metabench commented on Feb 26, 2015

    @metabench
    Author

    @bnoordhuis 'You may have to remove the cache first' - I don't know what cache you mean.

  10. bnoordhuis commented on Feb 26, 2015

    @bnoordhuis
    Member

    node-gyp downloads the source tarball from (if all is well) iojs.org but it caches it locally so it doesn't have to redownload it every time you build an add-on.

    The npm-debug.log file is normally written to the directory you ran npm install whatever in. If you run node-gyp directly, there will be no such file, everything will be logged to the console.

  11. metabench commented on Feb 26, 2015

    @metabench
    Author

    @bnoordhuis Would that be the source tarball that node-gyp downloads when it installs?

  12. metabench commented on Feb 26, 2015

    @metabench
    Author

    @bnoordhuis I did not see it download a tarball after I installed iojs from the Windows installer. I do remember node-gyp had downloaded tarballs of node in the past though.

  13. added
    c++Issues and PRs that require attention from people who are familiar with C++.
    and removed
    c++Issues and PRs that require attention from people who are familiar with C++.
    on Feb 26, 2015
  14. metabench commented on Feb 26, 2015

    @metabench
    Author

    @bnoordhuis and all, I have solved the problem I was having.

    There may have been a few things wrong with my setup here, I'm not sure which step got it to run. That said, I'll describe what I did.

    Uninstall node
    Uninstall iojs
    Install iojs, with all options selected
    Delete all files that had been built in my project
    (verify that I can actually install and run C++ addons, using npm install binaryjs and npm install mmmagic, then loading them through the node terminal with require)
    Go to my project's directory in the command prompt
    run npm install

    I had been having problems because rather than doing npm install, I had been doing node-gyp configure, node-gyp build.

    I think there still is an issue with iojs not easily running as a drop-in replacement for node while keeping exactly the same work-flow.

    Do people agree there is still an issue here? I think the issue software-wise is far less severe than I had thought at first, but there is still a problem because something no longer works like it used to.

  15. 34 remaining items

  16. Fishrock123 commented on May 6, 2015

    @Fishrock123
    Contributor

    Closing, as the delay-load hook is enabled by default in io.js 2.0.0, please report back if this is still an issue.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    c++Issues and PRs that require attention from people who are familiar with C++.windowsIssues and PRs related to the Windows platform.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions