Reputation: 677
I'm trying to run an electron application on raspberry pi. When I use
var TJBot = require('tjbot')
in my code to import a node package, the following error occurs:
## There is an issue with `node-fibers` ##
`/Users/apple/app/node_modules/asyncawait/node_modules/fibers/bin/darwin-x64-53/fibers.node` is missing.
Try running this to fix the issue: /Users/apple/app/node_modules/electron/dist/Electron/
app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper
/Users/apple/app/node_modules/
asyncawait/node_modules/fibers/build
Uncaught Error: Missing binary. See message above.
at Object.<anonymous> (/Users/apple/app/node_modules/asyncawait/node_modules/fibers/fibers.js:20:8)
at Object.<anonymous> (/Users/apple/app/node_modules/asyncawait/node_modules/fibers/fibers.js:26:3)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
If I remove this line or run it without using electron, everything works fine, so I'm not sure if this node library has a issue or it is caused by electron
Inside /Users/apple/app/node_modules/asyncawait/node_modules/fibers/bin/
I can see
darwin-ia32-46 darwin-x64-48 linux-ia32-48 repl win32-x64-46
darwin-ia32-48 darwin-x64-51 linux-x64-46 win32-ia32-46 win32-x64-48
darwin-x64-46 linux-ia32-46 linux-x64-48 win32-ia32-48
Why do I need darwin-x64-53
and where does it come from?
Upvotes: 3
Views: 4081
Reputation: 280
I had the same problem on Linux mint and I solved it as follows; Based on github source for node-fibers section about installing from the source;
git clone git://github.com/laverdet/node-fibers.git
cd node-fibers
npm install
Then I created a new directory;
mkdir /usr/local/lib/node_modules/iron-meteor/node_modules/fibers/bin/linux-x64-57/
Then I copied fibers.node to the newly created directory;
cp bin/linux-x64-57-glibc/fibers.node /usr/local/lib/node_modules/iron-meteor/node_modules/fibers/bin/linux-x64-57/
Then everything worked for me. You might have to adjust your permissions.
Upvotes: 1
Reputation: 2800
Fibers is built to native binary code, it is not pure javascript. Rasperry Pi runs on ARM, which isn't included in the prebuilt binaries. The prebuilt binaries support 32 and 64 bit architectures for OSX (darwin), linux, and windows.
This means you need to manually build Fibers for your system, not install it via NPM. The README for Fibers has clear instructions on how to do so. I've included them here for ease of access. Please follow these instructions to try and get it running on Raspberry Pi / ARM.
git clone git://github.com/laverdet/node-fibers.git
cd node-fibers
npm install
Note: node-fibers uses node-gyp for
building. To manually invoke the build process, you can use node-gyp rebuild
.
This will put the compiled extension in build/Release/fibers.node
. However,
when you do require('fibers')
, it will expect the module to be in, for
example, bin/linux-x64-v8-3.11/fibers.node
. You can manually put the module
here every time you build, or you can use the included build script. Either
npm install
or node build -f
will do this for you. If you are going to be
hacking on node-fibers, it may be worthwhile to first do node-gyp configure
and then for subsequent rebuilds you can just do node-gyp build
which will
be faster than a full npm install
or node-gyp rebuild
.
Upvotes: 5