russtheaerialist-retired-projects/node-spi

Error: Symbol _spi_module not found

Closed this issue · 5 comments

On Raspberry PI Node v0.9.9-pre node-spi would compile successfully but then complain when trying to execute "require('spi')".

pi@raspberrypi ~ $ node

require('spi')
Error: Symbol _spi_module not found.
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at bindings (/home/pi/node_modules/spi/node_modules/bindings/bindings.js:74:15)
at Object. (/home/pi/node_modules/spi/spi.js:19:31)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)

Fixed by changing line 38 in node-spi/src/spi_binding.cc to
NODE_MODULE(_spi, init);

This had to do with the name in NODE_MODULE matching the name in binding.gyp.

I did not make this into a pull request because I am not sure if this was just a problem with my specific installation of the package or the package as a whole.

+1 for me with node 0.10.5. Perhaps something changed with more recent versions of node? It was working earlier when I was running 0.8.21.

Sorry I haven't had time to work on this much lately. I'll take a look
tonight and see if I can duplicate and fix tonight.

On Wed, May 1, 2013 at 12:29 PM, Matt Olson notifications@github.comwrote:

+1 for me with node 0.10.5. Perhaps something changed with more recent
versions of node? It was working earlier when I was running 0.8.21.


Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-17301071
.

+1 for this, I hit the same issue with node 0.10.5, and adding the underscore as bstrysko described fixed it for me.

This fix worked for me too on Raspberry Pi, node v0.10.5, npm v1.2.18 after a 'npm rebuild spi'

Brilliant sir. It worked for me as well. I'm using node v0.10.1.