Errors after requiring npm package

Viewed 3288

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?

2 Answers

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.

Related