I know how to package and then deploy meteor application. But recently for one project i'm stuck at an error which i couldn't resolve.
Steps I followed for package and deploy of my meteor app:
1. meteor build package
2. cd package
3. tar -xf inventoryTool.tar.gz
4. cd bundle/programs/server
5. npm install
6. cd ../..
7. PORT=<port> MONGO_URL=mongodb://127.0.0.1:27017/dbName ROOT_URL=http://<ip> node main.js
Here is the log for the error when i run the npm install(STEP 5) command.
Is there anything missing in my execution?. I'm not using the fibers package anywhere in my project. Does anyone have solution to this problem? Thanks in advance.
Why this happens (a lot)?
Your local version of node is
v8.9.4. When using the build command, you will export your application and build the code against this exact node version. Your server environment will require this exact version, too.An excerpt from the custom deployment section of the guide:
Even if you don't use
fibersexplicitly it will be required to run your Meteor app on the server correctly.So what to do?
In order to solve this, you need to
a) ensure that your local version of node exactly matches the version on the server
b) ensure that you build against the server's architecture (see build command)
To install a) the very specific node version on your server you have two options:
Option I. Use
n, as described here. However this works only if your server environment usesnodeand notnodejs(which depends on how you installed nodejs on the server).II. To install a specific
nodejsversion from the repositories, you may do the following:If you are not sure, which of both are installed on your server, check
node -vandnodejs -v. One of both will return a version. If yournpm installstill fails, check the error output and if it involves eithernodeornodejsand install the desired distribution using the options above.To build b) against the architecture on your server, you should use the
--architectureflag in yourbuildcommand.