Meteor 0.9.0 bundle and deploy throw errors

I upgraded to Meteor 0.9.0 today. I use meteor bundle filename to bundle my application and upload to AWS. When I try to start it on AWS, I get

wrong ELF class: ELFCLASS32

This is a known problem with fibers/bcrypt, so I used to go to bundle/programs/server/node_modules, remove the fibers and bcrypt folders and reinstalling them (npm install).

However, currently the node_modules directory does not exist anymore... When I am trying to start nodejs I get

Error: Cannot find module 'underscore'

I tried to manually add the modules with npm install, and even got the server to eventually run, but the client didn't load and the console error was about

Spacebars undefined

(I don't have the exact Spacebar issue)

I know that Meteor 0.9.0 is very new, but if you have advice I would really appreciate it!

You don't need to remove any folders, simply do this in the bundle directory (output of the untarred meteor bundle):

cd bundle
cd programs/server
npm install

Meteor 0.9.0 makes sure it puts up all the node_modules which don't contain binaries, and creates a package.json for npm install for both bcrypt and fibers

Since you've removed the npm modules in node_modules you may have to recreate the bundle from scratch to get them back.

For the Spacebars undefined issue its very likely that you have a package in your project that is not compatible with Meteor 0.9.0. You can find out which one it is by checking your server logs. Though it is not compatible, your app will still run.

This may be boostrap-3, though it may not be. If it is you can meteor remove mrt:bootstrap-3 and meteor add mizzao:bootstrap-3.

Akshat, you are a lifesaver! Based on your answer I eventually managed to figure it out! For the benefit of others, I want to document what eventually worked:

First, I had to manually remove all the old packages from my Meteor project (seems that it didn't do it automatically). In particular, I removed

iron-router 

which was the pre-Meteor 0.9 version and installed

iron:router 

which is the post-Meteor 0.9 version. (I had to do a similar process of removing and adding different packages for 2-3 other packages too).

Then, once I bundled and unpacked on AWS, I did what Akshat said about npm install in bundle/programs/server. In addition, I had to manually remove the original bctypt by deleting the folder

bundle/programs/server/npm/npm-bcrypt

as otherwise I got an ELS error

If you're getting this error with Meteor-Up. Updating the package should fix it.

npm update mup -g