Switching from one Meteor workspace to another

Tags: meteor

Example: you made the "todos" example, and it is running. Suddenly, you want to start a brand new project called "watermelon". It was my assumption that I would be able to just cd ~/watermelon run meteor again, and have it switch. Not so. Suggestions? Maybe I should feature request this.

Meteor doesn't show up in jobs either, so I can't figure out how to kill it.

You should have no problem running multiple meteor projects at once, just make sure your running on different ports.

todo : meteor
watermelon : meteor --port 5000

Note, meteor uses ports N+1 & N+2 (so don't use port 3001 or 3002).

I just tested it and what you suggested seems to work here:

meteor create foo
cd foo
vim foo.html # Edit some stuff
meteor # visit http://localhost:3000 in a browser, foo stuff shows up
# Ctrl-C meteor
cd ..
meteor create bar
meteor # Visit http://localhost:3000, and a brand new project shows up

You might need to be sure you closed the meteor server that was running in the other project. If you ran it in the background, try something like this to get the pid and kill it:

ps ax | grep node | grep meteor # Look at the output and note the PID number on the left
kill <that pid value>

You can wrap that all up in a single shell command (which you could add as a script somewhere for convenience) like this:

kill `ps ax | grep node | grep meteor | cut -d ' ' -f 1`

All of that assumes you're in a Linux or OS X environment. If you're running windows, you'll probably need to use task manager, process explorer, or something similar to find the node.js process that's running. Sort processes by name and look for something that starts with "node".

By : Benson

This video can help you solving your question :)
By: admin