The status of Meteor on Windows in 2017

sammyisa

Sammy Israwi

Posted on November 3, 2017

The status of Meteor on Windows in 2017

Premise and fall from grace ☄️

If you don't care about backstory, jump to "And then we're here".

If you don't know about Meteor, I suggest you read the official pitch on their website. This article is more about the state of it on Windows today.

Ok so, Meteor for me is how I got into web development for real. I used it heavily in 2015 for my Summer internship at Spiceworks after my mentor recommended it. An easy to use, full stack Javascript framework that blurs the line between Front end and Back end? I was in love!

Sure, it had some performance issues on Windows, but nothing breaking. At the time, I didn't really have to care about deployment since we were dealing with a demo. We could use the free demo hosting MDG provided for Meteor applications.

From the start, Meteor always considered Windows as a side thought, never giving true mobile support for Windows.

I even gave a couple of talks to the local ACM chapter about it! Did a demo deployment and everyone was surprised and they were starting to see why Meteor was great. Meteor was my solve-all solution.

ACM Presentation cover
From my presentation for ACM

Fast forward to one particularly annoying afternoon. A couple of friends asked me to do a short workshop on Meteor to get their feet wet. We could not even get Meteor running on their machines. The installer would work, and it would create the starter project, but the project would not run. After some digging and googling, we found out it was a Windows-specific issue on the current version. Delete everything and start a new project with an older version and no problem.

After that, it was one issue after another. I decided to use it last year for Georgia Tech Hackathon where my friends and I decided to create FlavoredNews: a news client that would sentimentally analyze news and color code them. It was an interesting project, and to my delight Meteor was working flawlessly until we had to deploy. We spent over an hour and a half figuring out how to deploy for free (probably would have been less time if I weren't sleep deprived) and in the end decided to deploy it to MDG's very own Galaxy and eat the cost. Granted, it ended up being only a few dollars at most; but we were expecting to spend a grand total of zero dollars (as we usually do in Hackathons).

Sometimes you just want to bundle and deploy to a platform like Azure and AWS, where you are either in a free tier or have student credits.

I recently was pointed towards this article that gives you a step by step process for deploying Meteor apps to Heroku, we will be trying that out for size today.

After the entire debacle left a sour taste, I dropped Meteor hoping to pick it up in the future when it had better Windows support.

TL;DR: Meteor promises a lot as long as your dev machine is not Windows

And then we're here! 🏁

We're going to try something really simple today. My goal is to install Meteor create an application, do some minor changes, and deploy to Heroku using this guide mentioned above or something similar.

Important note:
This article was modified from the original publication. A little after making the article public, I attempted a few more things and Meteor worked as intended. Simple stuff like giving the choco installer more time to finish did the trick. Anything after this point is more accurate to what I discovered after publishing.
Sorry for the confusion!

For reference, here is my OS info:

PS C:\Users\Sammy-Surface> systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.15063 N/A Build 15063
Enter fullscreen mode Exit fullscreen mode

Installing 💻

Installing seems fairly simple these days:

Install steps

So, run the command on an admin shell and wait for a bit for the download and installation process to finish.

If you are erroring out, there is a good chance the choco installer is timing out. To increase the timeout, run instead:

PS C:\Users\Sammy-Surface> choco install meteor -y --execution-timeout 10000
Enter fullscreen mode Exit fullscreen mode

Keep in mind, this process will take a while.

Starting a project 🚦

Creating a project is also simple. On a terminal, run:

PS C:\Users\Sammy-Surface\Development> meteor create nothing-app
Enter fullscreen mode Exit fullscreen mode

This may take a while; Meteor is not a lightweight platform.

At this point, there is are a few common errors that will stop your progress. If you get an NPM error during the create process, there is a chance your environment was not reset after installing Meteor. Try to close all command prompts and terminals you have open and reopen it. There are a few other errors that may pop up, hopefully you can find your answer here.

Development 🛠️

For the development section, we will add support for users in our boilerplate app. For starters, we will add the meteor packages accounts-ui and accounts-password:

PS C:\Users\Sammy-Surface\Development\nothing-app> meteor add accounts-ui accounts-password

Changes to your project's package version selections:

...

accounts-ui: Simple templates to add login widgets to an app
accounts-password: Password support for accounts

Enter fullscreen mode Exit fullscreen mode

We will set up the configuration for the Accounts package on client/main.js. If you have on file only what is relevant, it should look like this:

import { Template } from 'meteor/templating';
import { ReactiveVar } from 'meteor/reactive-var';
import { Accounts } from "meteor/accounts-base";

import './main.html';

Accounts.ui.config({
  passwordSignupFields: "USERNAME_ONLY",
});

Enter fullscreen mode Exit fullscreen mode

And somewhere in your main.html, add:

<div class="login">
    {{> loginButtons}}
</div>
Enter fullscreen mode Exit fullscreen mode

Now your website should look like this!

See your first changes on the website

We did not hit any snags! Good for us, proud of Meteor over here. Installing packages easy and it worked.

Deployment 🚀

For this section, we will follow this ten step guide mentioned above. This will mean we are deploying to Heroku, therefore you need to set up an account with Heroku and download the Heroku CLI

There are two key points to remember here:

  • We are using a custom buildpack made specifically for Meteor. There are many of these out there, this one is updated and currently maintained.
  • We are using a remote MongoDB instance instead of a local version of it.

And that's it! Go to your Heroku app's website and you will see your application!

Conclusion 📓

It was painful to set up Meteor initially, but once we installed the app we were done for hurdles. Support for Windows is still a side thought, but it is not impossible to be a Windows Meteor Developer. However, I am not a fan of the snags we hit because of our choice of OS. As a developer, the less time I have to spend setting up and bootstrapping a project, the better.

Deployment on Heroku is easy and convenient! Hopefully, the buildpack will be maintained for a while.

I am a fan of these quick build frameworks that allow you to deliver quickly. I will be (cautiously) coming back to Meteor.

Alternatively, if anyone knows frameworks that work similarly to Meteor, I am always looking to explore new ways to build stuff!

While I have your attention, look at the 👿 entry on EmojiPedia. Anything else that looks... Off?

💖 💪 🙅 🚩
sammyisa
Sammy Israwi

Posted on November 3, 2017

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related