2

I've spent a couple of days trying to run a build app from Meteor on my Synology ds213j (Armv7, 512MB ram).

I keep encountering the following error

## There is an issue with `node-fibers` ##
`/volume1/homes/user/app/bundle/programs/server/node_modules/fibers/bin/linux-arm-57/fibers.node` is missing.

Try running this to fix the issue: /volume1/homes/user/.nvm/versions/node/v8.11.2/bin/node /volume1/homes/user/app/bundle/programs/server/node_modules/fibers/build
Error: /volume1/homes/user/app/bundle/programs/server/node_modules/fibers/bin/linux-arm-57/fibers.node: internal error
    at Object.Module._extensions..node (module.js:681:18)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/volume1/homes/user/app/bundle/programs/server/node_modules/fibers/fibers.js:13:39)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
/volume1/homes/user/app/bundle/programs/server/node_modules/fibers/fibers.js:22
                throw new Error('Missing binary. See message above.');
                ^

Error: Missing binary. See message above.
    at Object.<anonymous> (/volume1/homes/user/app/bundle/programs/server/node_modules/fibers/fibers.js:22:9)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/volume1/homes/user/app/bundle/programs/server/boot.js:1:75)
    at Module._compile (module.js:652:30)

BUT, fibers.node actually EXIST!

What I did before:

  • build meteor app meteor build --server-only --architecture os.linux.x86_32

  • on the /program/server folder npm install --production

  • npm install fibers

What I tried to fix it:

  • go to /programs/server/ and run npm install fibers (and reinstall)
  • installing from source following the instructions on https://www.npmjs.com/package/fibers

  • my meteor app uses Node 8.11.2 but the only node version available for synology is 8.9.4. Removed it and manually installed the 8.11.2

  • build an default meteor app to check if is my app giving problems.

Nothing worked so far and I have no idea what to do next.

I suspect the problem is that fibers is built for linux-arm-57 and I suppose I need arm-7I? There is something I can do to make this work?

Thanks!

Patch
  • 53
  • 1
  • 1
  • 6
  • Hi Patch, good quality question format. I will try to reproduce your issue with my Raspberry Pi 3 which has also ARM7. In the meantime you can search the web for deploying Meteor apps to the RPI, maybe you will find a good todo-manual there already. – Jankapunkt Aug 31 '18 at 05:52
  • Thank you for your attention Jankapunkt! I will search in the meanwhile – Patch Aug 31 '18 at 08:31

1 Answers1

2

In the following I describe the way you correctly deploy your app to an ARMv7 device. By doing so I will highlight important steps that may often be cause of errors. I hope your problem will solve by reproducing these steps.

1. Build your production app

  • Make sure the app starts, runs and all your tests pass on local.
  • Get your current development version of node. Note, that it varies, depending on the meteor version your project uses. Note: The meteor guide on custom deployment underlines the importance of a matching node version.
$ cd ~/path/to/meteor-project
$ meteor node -v
v8.9.4 # this example uses Meteor 1.6.1 which uses node 8.9.4
  • build your production app using the build command (I adapted your specs a bit here).
$ cd ~/path/to/meteor-project
$ meteor npm install --production
$ meteor build ../build/deployment-test --server-only --architecture os.linux.x86_32

2. Prepare your target device' environment

  • Meteor builds are also Node.js applications. Your device will require an ARMv7 build of Node.js. The easiest way to do that is to use the install script from nodesource (open in new tab to view the script).
$ curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
$ sudo apt-get install -y nodejs
  • Note, that official node installation guide also points out, that "To compile and install native addons from npm you may also need to install build tools". You will need this, because fibers or bcrypt are such native addons.
$ sudo apt-get install -y build-essential
  • Verify your installed node version
$ node -v
v8.11.4 # but we need v8.9.4
  • The easiest way to get the correct version of node, that exactly matches your development version, is to use the npm n package.
$ sudo npm install -g n
$ sudo n 8.9.4
$ # ... installs target version
$ node -v
v8.9.4 # if this is still the old version just restart the shell
  • if you need help on this, read this github issue thread
  • finally install mongodb >= 2.6 (important!) on your target device (not covered in this answer).

3. Install your production app on the target device

  • copy / move / upload your build archive to your target device
  • extract your deployment bundle
$ cd ~/path/to/deploymentapp
$ tar -xvzf ./meteor-project.tar.gz # extracts all content into a folder named 'bundle'
  • install npm dependencies on target system
$ cd bundle/programs/server/
$ npm install --production
  • if you have replicated all the above steps the npm packages (and espeically the native packages, such as fibers or bcrypt) should be installed here without any errors. Now go back to bundle/ and start the app:
$ cd ../../
$ MONGO_URL=mongodb://yourmongodbcredentials node main.js

I hope by replicating this guide you will find a solution to your problem.


Added for SEO reasons: This guide shows how to deploy a Meteor app on a Raspberry PI with ARMv7 architecture and Raspbian (32 bit) installed. It can also be used as a foundation for other ARMv7 devices, such as OP's Synology.
Jankapunkt
  • 8,128
  • 4
  • 30
  • 59
  • Thank you for the exhaustive explanation! Next days when I'm gonna look into it. Gonna reinstall the device and start clean, at the moment I'm not confident anymore that my system is not in someway broken. I'll let you know. – Patch Sep 05 '18 at 18:03
  • Did you resolve this issue? If you have problems with your environment we can continue in the chat. – Jankapunkt Sep 14 '18 at 20:46
  • I'm really sorry, I still have to look into it :( hopefully soon! – Patch Sep 15 '18 at 21:08