I’m trying to deploy my Meteor app to Ubuntu 16.04, I run
sudo nodejs main.js
It throws an error ,
Error: MONGO_URL must be set in environment
at Object.<anonymous> (packages/mongo/remote_collection_driver.js:36:11)
at Object.defaultRemoteCollectionDriver (packages/underscore.js:784:19)
at new Mongo.Collection (packages/mongo/collection.js:99:40)
at AccountsServer.AccountsCommon (packages/accounts-base/accounts_common.js:23:18)
at new AccountsServer (packages/accounts-base/accounts_server.js:18:5)
at meteorInstall.node_modules.meteor.accounts-base.server_main.js (packages/accounts-base/server_main.js:9:12)
at fileEvaluate (packages/modules-runtime.js:197:9)
at require (packages/modules-runtime.js:120:16)
at /home/ubuntu/bundle/programs/server/packages/accounts-base.js:2019:15
at /home/ubuntu/bundle/programs/server/packages/accounts-base.js:2030:3
But I have already set this environment variable, for example, I run
echo $MONGO_URL
sudo echo $MONGO_URL
Both commands can print the value of $MONGO_URL
correctly