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

https://iojs.org/api/addons.html hello world doesn't work on windows #1526

Closed
kolodny opened this issue Apr 26, 2015 · 14 comments
Closed

https://iojs.org/api/addons.html hello world doesn't work on windows #1526

kolodny opened this issue Apr 26, 2015 · 14 comments
Labels
windows Issues and PRs related to the Windows platform.

Comments

@kolodny
Copy link

kolodny commented Apr 26, 2015

I tried following the simple example at https://iojs.org/api/addons.html

You can see the code and error at this example repo I've also attached the error I'm getting below:

module.js:353
  Module._extensions[extension](this, filename);
                               ^
Error: Module did not self-register.
    at Error (native)
    at Module.load (module.js:353:32)
    at Function.Module._load (module.js:308:12)
    at Module.require (module.js:363:17)
    at require (module.js:382:17)
    at Object.<anonymous> (c:\Users\Kolodny\Documents\RandomProjects\node-addon-test\hello.js:2:13)
    at Module._compile (module.js:428:26)
    at Object.Module._extensions..js (module.js:446:10)
    at Module.load (module.js:353:32)
    at Function.Module._load (module.js:308:12)

I'm using v1.8.1

@jbergstroem jbergstroem added the windows Issues and PRs related to the Windows platform. label Apr 26, 2015
@mscdex
Copy link
Contributor

mscdex commented Apr 26, 2015

Does this new issue mean that #1525 is no longer valid?

@mscdex
Copy link
Contributor

mscdex commented Apr 26, 2015

Also, are you using the iojs or the node binary in your command line to execute the script?

@kolodny
Copy link
Author

kolodny commented Apr 26, 2015

It appears to work if I invoke it with iojs but not when I invoke it with node

@brendanashworth
Copy link
Contributor

I don't think they'll be compatible with each other, as they were probably compiled against different versions of v8. Recompiling for each respective binary should work though.

@kolodny
Copy link
Author

kolodny commented Apr 26, 2015

I thought node is just an alias of iojs:

Kolodny@HOME-DESKTOP ~
$ which iojs
/c/Program Files/iojs/iojs

Kolodny@HOME-DESKTOP ~
$ which node
/c/Program Files/iojs/node

Kolodny@HOME-DESKTOP ~
$ node --version
v1.8.1

Kolodny@HOME-DESKTOP ~
$ iojs --version
v1.8.1'

Kolodny@HOME-DESKTOP ~
$ ls -l /c/Program\ Files/iojs/
total 8624
-rwxr-xr-x    2 Kolodny  Administ  8821864 Apr 21 00:35 iojs.exe
-rwxr-xr-x    2 Kolodny  Administ  8821864 Apr 21 00:35 node.exe

@mscdex
Copy link
Contributor

mscdex commented Apr 26, 2015

This is an issue specific to Windows. I believe there will be a fix for this in io.js 2.0.0 that will work for the majority of addons. See #1433 for more details.

@mscdex mscdex changed the title https://iojs.org/api/addons.html hello world doesn't work on windws https://iojs.org/api/addons.html hello world doesn't work on windows Apr 27, 2015
@Fishrock123
Copy link
Contributor

Does this work now that #1433 has been merged?

@kolodny
Copy link
Author

kolodny commented Apr 28, 2015

Don't know, I'm getting a 404 on the tarball now:

$ node --version
v2.0.0-nightly20150427547213913b

$ npm install

npm WARN package.json node-addon-test@1.0.0 No repository field.
npm WARN package.json 2@0.0.1 No repository field.

> node-addon-test@1.0.0 install c:\Users\Kolodny\Documents\RandomProjects\node-addon-test
> node-gyp rebuild


c:\Users\Kolodny\Documents\RandomProjects\node-addon-test>if not defined npm_config_node_gyp (node "c:\Program Files\iojs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (rebuild) 
gyp WARN install got an error, rolling back install
gyp ERR! configure error 
gyp ERR! stack Error: 404 status code downloading tarball
gyp ERR! stack     at Request.<anonymous> (c:\Program Files\iojs\node_modules\npm\node_modules\node-gyp\lib\install.js:246:14)
gyp ERR! stack     at emitOne (events.js:82:20)
gyp ERR! stack     at Request.emit (events.js:166:7)
gyp ERR! stack     at Request.onRequestResponse (c:\Program Files\iojs\node_modules\npm\node_modules\request\request.js:1156:10)
gyp ERR! stack     at emitOne (events.js:77:13)
gyp ERR! stack     at ClientRequest.emit (events.js:166:7)
gyp ERR! stack     at HTTPParser.parserOnIncomingClient (_http_client.js:414:21)
gyp ERR! stack     at HTTPParser.parserOnHeadersComplete (_http_common.js:88:23)
gyp ERR! stack     at TLSSocket.socketOnData (_http_client.js:304:20)
gyp ERR! stack     at emitOne (events.js:77:13)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "c:\\Program Files\\iojs\\node.exe" "c:\\Program Files\\iojs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd c:\Users\Kolodny\Documents\RandomProjects\node-addon-test
gyp ERR! node -v v2.0.0-nightly20150427547213913b
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok 

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "c:\\Program Files\\iojs\\node.exe" "c:\\Program Files\\iojs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v2.0.0-nightly20150427547213913b
npm ERR! npm  v2.8.3
npm ERR! code ELIFECYCLE
npm ERR! node-addon-test@1.0.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-addon-test@1.0.0 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the node-addon-test package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls node-addon-test
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     c:\Users\Kolodny\Documents\RandomProjects\node-addon-test\npm-debug.log

@kkoopa
Copy link

kkoopa commented Apr 28, 2015

Why don't you just set 'win_delay_load_hook': 'true' in binding.gyp and call it a day?

@kolodny
Copy link
Author

kolodny commented Apr 29, 2015

@kkoopa that doesn't work with either:

npm WARN package.json node-addon-test@1.0.0 No repository field.
npm WARN package.json 2@0.0.1 No repository field.

> node-addon-test@1.0.0 install c:\Users\Kolodny\Documents\RandomProjects\node-addon-test
> node-gyp rebuild


c:\Users\Kolodny\Documents\RandomProjects\node-addon-test>if not defined npm_config_node_gyp (node "c:\Program Files\iojs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (rebuild) 
Traceback (most recent call last):
  File "c:\Program Files\iojs\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 18, in <module>
    sys.exit(gyp.script_main())
  File "c:\Program Files\iojs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 534, in script_main
    return main(sys.argv[1:])
  File "c:\Program Files\iojs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 527, in main
    return gyp_main(args)
  File "c:\Program Files\iojs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 503, in gyp_main
    options.circular_check)
  File "c:\Program Files\iojs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 129, in Load
    params['parallel'], params['root_targets'])
  File "c:\Program Files\iojs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 2692, in Load
    variables, includes, depth, check, True)
  File "c:\Program Files\iojs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 362, in LoadTargetBuildFile
    includes, True, check)
  File "c:\Program Files\iojs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 219, in LoadOneBuildFile
    None)
  File "<string>", line 8, in <module>
NameError: name 'true' is not defined while reading binding.gyp while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (c:\Program Files\iojs\node_modules\npm\node_modules\node-gyp\lib\configure.js:343:16)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:169:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1009:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "c:\\Program Files\\iojs\\node.exe" "c:\\Program Files\\iojs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd c:\Users\Kolodny\Documents\RandomProjects\node-addon-test
gyp ERR! node -v v1.8.1
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok 

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "c:\\Program Files\\iojs\\node.exe" "c:\\Program Files\\iojs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v1.8.1
npm ERR! npm  v2.8.3
npm ERR! code ELIFECYCLE
npm ERR! node-addon-test@1.0.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-addon-test@1.0.0 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the node-addon-test package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls node-addon-test
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     c:\Users\Kolodny\Documents\RandomProjects\node-addon-test\npm-debug.log

@kkoopa
Copy link

kkoopa commented Apr 29, 2015

Strange. Did you put it in the right location in binding.gyp?

{
  'targets': [
    {
      'target_name': 'foo',
      'win_delay_load_hook': 'true',
      ...

@kolodny
Copy link
Author

kolodny commented May 4, 2015

I originally put it as a sibling to targets, it works now as a prop inside it

@brendanashworth
Copy link
Contributor

@kolodny is this issue fixed?

@kolodny
Copy link
Author

kolodny commented Jun 8, 2015

@brendanashworth Yup, fixed, thanks :)

@kolodny kolodny closed this as completed Jun 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

No branches or pull requests

6 participants