goingnative icon indicating copy to clipboard operation
goingnative copied to clipboard

Getting the following error. Everything specified is installed.

Open pixelpax opened this issue 8 years ago • 8 comments

✗ Could not properly compile test addon, did not load binding ✗ /usr/local/lib/node_modules/goingnative/exercises/am_i_ready/child.js:17 ✗ if (binding.test !== 'OK') { ✗ ^ ✗ TypeError: Cannot read property 'test' of undefined ✗ at Object. (/usr/local/lib/node_modules/goingnative/exercises/am_i_ready/child.js:17:12) ✗ at Module._compile (module.js:397:26) ✗ at Object.Module._extensions..js (module.js:404:10) ✗ at Module.load (module.js:343:32) ✗ at Function.Module._load (module.js:300:12) ✗ at Function.Module.runMain (module.js:429:10) ✗ at startup (node.js:139:18) ✗ at node.js:999:3 ✗ Test binding file works as expected

pixelpax avatar Apr 10 '16 15:04 pixelpax

is that the only output? can you provide details on your operating system and version of Node.js please?

rvagg avatar Apr 11 '16 02:04 rvagg

I'm using #38-Ubuntu SMP with 3.19.0-33-generic kernel.

Node is v5.4.1 gcc (Ubuntu 4.9.2-10ubuntu13) 4.9.2

Here's the full output:

✓ Found usable `node` version: v5.4.1
✓ Found usable `gcc` in $PATH: v4.9.2
✓ Found usable `python` in $PATH: v2.7.9
✓ Found usable `node-gyp` in $PATH: v0.12.2
Running `node-gyp`, this may take a few minutes if it hasn't been run before...
make: Entering directory '/media/gabriel/Windows8_OS/Users/Gabriel/Dropbox/goingnative/~test-addon.7522/build'
  CXX(target) Release/obj.target/test/test.o
  SOLINK_MODULE(target) Release/obj.target/test.node
  SOLINK_MODULE(target) Release/obj.target/test.node: Finished
  COPY Release/test.node
make: Leaving directory '/media/gabriel/Windows8_OS/Users/Gabriel/Dropbox/goingnative/~test-addon.7522/build'
✓ Compiled test package
✓ Found compiled test binding file
✗ Could not properly compile test addon, error finding binding: Module did not self-register.
✗ Could not properly compile test addon, did not load binding
✗ /usr/local/lib/node_modules/goingnative/exercises/am_i_ready/child.js:17
✗ if (binding.test !== 'OK') {
✗            ^
✗ TypeError: Cannot read property 'test' of undefined
✗     at Object.<anonymous> (/usr/local/lib/node_modules/goingnative/exercises/am_i_ready/child.js:17:12)
✗     at Module._compile (module.js:397:26)
✗     at Object.Module._extensions..js (module.js:404:10)
✗     at Module.load (module.js:343:32)
✗     at Function.Module._load (module.js:300:12)
✗     at Function.Module.runMain (module.js:429:10)
✗     at startup (node.js:139:18)
✗     at node.js:999:3
✗ Test binding file works as expected

# FAIL

pixelpax avatar Apr 11 '16 04:04 pixelpax

@HeroicAutodidact would you mind trying it in a different directory? It could be that the file system type that's being used isn't playing so nicely here. Perhaps switch to /tmp/ and run through it again and see if it makes a difference. The fact that's it's getting past the compile step suggests that it's something to do with loading from the filesystem .. I think

rvagg avatar Apr 11 '16 14:04 rvagg

Alright, I tried this, identical message. I've also tried locally installing goingnative, and I've tried executing gonative as root.

Any other ideas?

Is there someplace I can see which commands are being executed by gonative during the verify step? I can try executing individually and testing where the error is.

pixelpax avatar Apr 11 '16 15:04 pixelpax

@HeroicAutodidact

https://github.com/workshopper/goingnative/blob/master/exercises/am_i_ready/child.js#L13-L19

The line immediately above accessing .test checks to see if binding is defined and outputs an error.

@rvagg shouldn't we be breaking execution when each of those checks fail?

retrohacker avatar Apr 11 '16 15:04 retrohacker

https://github.com/workshopper/goingnative/blob/master/exercises/am_i_ready/exercise.js

it's compiling an addon in ../../packages/test-addon/ and then trying to load it with child.js.

rvagg avatar Apr 11 '16 15:04 rvagg

@retrohacker it is broken when one fails, as it has in this case, the callback in each of the processors controls that, the false as a second argument indicates a proper fail.

rvagg avatar Apr 11 '16 15:04 rvagg

We can at least avoid the TypeError for referencing a value we already know is undefined from a previous check.

if(binding != null && binding.test !== 'OK')

retrohacker avatar Apr 11 '16 15:04 retrohacker