Sujit Rai
Sujit Rai

Reputation: 455

Meteor code not working on ec2

i created tar.gz file from my dev meteor project directory which is working on my local machine but the extract of tar.gz is not working on ec2. It showing following error.

W20150815-19:56:58.515(0)? (STDERR) 
W20150815-19:56:58.516(0)? (STDERR) /home/ubuntu/.meteor/packages/meteor-tool/.1.1.3.1md4rq1++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245
W20150815-19:56:58.517(0)? (STDERR)                         throw(ex);
W20150815-19:56:58.518(0)? (STDERR)                               ^
W20150815-19:56:58.522(0)? (STDERR) Error: Cannot find module 'elasticsearch'
W20150815-19:56:58.522(0)? (STDERR)     at Function.Module._resolveFilename (module.js:338:15)
W20150815-19:56:58.522(0)? (STDERR)     at Function.Module._load (module.js:280:25)
W20150815-19:56:58.522(0)? (STDERR)     at Module.require (module.js:364:17)
W20150815-19:56:58.522(0)? (STDERR)     at require (module.js:380:17)
W20150815-19:56:58.522(0)? (STDERR)     at Object.Npm.require (/home/ubuntu/snapstall/.meteor/local/build/programs/server/boot.js:130:18)
W20150815-19:56:58.523(0)? (STDERR)     at app/server/elastic.js:1:60
W20150815-19:56:58.523(0)? (STDERR)     at app/server/elastic.js:59:3
W20150815-19:56:58.523(0)? (STDERR)     at /home/ubuntu/snapstall/.meteor/local/build/programs/server/boot.js:222:10
W20150815-19:56:58.523(0)? (STDERR)     at Array.forEach (native)
W20150815-19:56:58.523(0)? (STDERR)     at Function._.each._.forEach (/home/ubuntu/.meteor/packages/meteor-tool/.1.1.3.1md4rq1++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)

Upvotes: 0

Views: 60

Answers (1)

Tomasz Lenarcik
Tomasz Lenarcik

Reputation: 4880

All npm dependencies of your application are declared inside package.json located in your bundle's programs/server subdirectory. To make sure they're all resolved you need to run

npm install

inside that subdirectory after unpacking the archive.

The reason it's not done automatically is both to have a bundle of smaller size and to make sure npm installs binaries (if any) that match your target system architecture, which may not necessarily be the same as the one you're creating the bundle in.

Upvotes: 1

Related Questions