Meteor JS is a development platform containing libraries and packages that you can use to create a prototype app. It literally takes hours—not months or even days—to get your first application up and running, if you build it with Meteor. Installing Meteor on a Windows machine is an easy process involving the following steps:
Let’s Get to Know Meteor, the Full-Stack JS Platform
- It is based on an isomorphic model. This is to say that the same code is used for everything, from the front-end to the back-end, for mobile and for web apps. It’s the same set of libraries, APIs, drivers, and module managers for everything. Furthermore, Meteor includes the ability to generate native Android and iOS apps, both from the same code base, written in a single language.
- Meteor’s prominent feature is that it facilitates real-time applications. Any development changes on the front-end will automatically reload live on the webpage. Apps built with Meteor will react immediately to user inputs. Any changes made on the server will auto update on the client side.
- Again, the code produced is cross-platform: Android, iOS, Web.
Meteor Installation is Easy But a Bit Tricky
This section is useful if you have not yet installed Meteor on your Windows machine, so feel free to skip it. Installation for OS X and Linux takes just one line of code from the terminal:
curl https://install.meteor.com/ | sh
A few years back, Windows users were able to download directly from installer.meteor.com/windows or through Git, with the GitHub repo. But these two were discontinued and now to install Meteor on Windows, we need Windows package manager, Chocolatey.
Before You Start
Please keep in mind that although Chocolatey is very easy to install, UNINSTALLING might not be the safest option.
1. Install Chocolatey
Chocolatey is a package manager for Windows. It can download, install, remove or upgrade apps from various places around the web directly from your computer. If you don’t have Chocolatey installed on your Windows machine yet, you will need to install it from the command line.
Before installing Chocolatey, there are some basic things you need to know. Although the manager is very easy to install, uninstalling might be an issue. Getting it off your system is not as easy as just removing the Chocolatey folder. During installation, it will create a folder within C:\ProgramData, which is a hidden folder that can only be accessed using Windows Administrator role.
You won’t be able to remove it from the list of available programs. And you’d have to remove the folder along with all the environment variables that come with it. It is probably safer not to uninstall Chocolatey and just let it stay in your system.
To install Chocolatey, follow these steps:
- Open the command prompt by typing “cmd” into the search box, click right, and then choose to “run as administrator”. If you don’t have administrator privileges, you can still install it by following the non-administrative installation guide available from the official Chocolatey website.
- Once you are within the command prompt, run the following code from the command line:
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
- When the installation is complete, the following message will be displayed:
2. Extra Step: Make Sure the Latest Version of Git is Installed
It is important to have Git installed on your machine before you install Meteor. Without Git, the installation will still run, but halfway through you will probably encounter pesky error messages containing the dreaded:
npm ERR! No git binary found in $PATH
That really gives away another requirement for installing Meteor, which isn’t explicitly mentioned in the official installation guide. But worry not. If you encountered this message, you just need to quickly install Git before you can go on to the next steps.
- If you have installed Git correctly on your machine, you'd be able to check which version of Git is currently running. At the time of writing, the most current version is Git version 2.21.0. To see which version you have, from the command line, type the following code:
- If the system message returns saying Git is not recognized, then you might need to install or reinstall Git. Or, try to open the Git Bash and run the same code again.
- If you reinstall, make sure the option to run Git from the command line and also third-party software is selected during the most recent installation:
- If your version of Git is deprecated, you need to update it by running either one of the following lines of code:
git update-git-for-windows git update
3. Tell Chocolatey to Install Meteor
With Chocolatey installed and Git updated, we can get on with the next part of the installation. The third step is to use the one simple line that tells Chocolatey to install Meteor:
choco install meteor
The installation can take quite a bit of time, so be patient. First, Chocolatey will install the package and other additional installation that requires your confirmation.
Type "Y" to allow for the installation to continue. When the installation is complete, the cursor will return to its normal position, blinking steadily.
After the installation comes the interesting bit of running your first line of code to make sure that your newly installed Meteor can do its job. Test it out. Create a new meteor project straight from the command prompt.
- First, navigate to the directory where you want to keep your first project files. If you’re still in system32, quickly change your directory into something else. Maybe your Public folder or your own directory.
- Run the basic meteor command to create a project. You can create a complete project or just a basic, empty project using --bare. Name your test project something like "firstapp" or "testapp".
meteor create testapp --bare
- If you wish to install a full app, don't add --bare at the end of your code and type this instead:
meteor create testapp
- Using "create" tells Meteor to prepare a subdirectory called “testapp” in your current directory. This ensures that Meteor is already installed and running. After you run this code, you should be able to see your new app folder among the other folders.
- Once you have installed an app, your application is live for viewing from the local host. To startup a local server so that we can view your test app, change your directory to the name of the app, and then run meteor:
cd testapp meteor
After hitting Enter or the return key, your app will be made available for view from your local server at http://localhost:3000/. (If you chose to create a bare project for the test, the local host will serve you a blank page.) You should see something like this on your command prompt:
=> Started proxy. => Started MongoDB. => Started your app. => App running at: http://localhost:3000/
NOTE: After creating your first test app, you can easily remove the folder manually or use the rmdir command to delete it from the command prompt. Using the /s switch will make sure that the full directory along with any additional subdirectories are removed.
rmdir testapp /s
Meteor Web Framework Resources
Although different people learn differently, it appears that the most effective way to master Meteor is to practice building real-life applications. Here are your main resources Meteor web development resources:
Meteor website for official guides
Now that you have Meteor in your system, you can start working on your first projects. Your first go-to for resources should be Meteor’s official website, where you can find tutorials and guides, example apps, and make your first contribution to the community. For more in-depth discussion with the community, you can ask for help or discuss issues within the Meteor discussion forums.
There are many online courses that can help you go beyond your first Meteor app. Some of the free ones on YouTube are Meteor for Everyone by LevelUpTuts, Meteor Learning by George McKnight, Diving into Meteor by Robert Lowe. There aren’t many free courses to learn Meteor, but you can take the Introduction to Meteor.Js Development from Coursera that offer a certificate for a small fee.
Meteor JS online courses
There’s plenty of classes to learn full-stack web development using Meteor JS on online learning platforms like Pluralsight, Lynda, or Udemy, where you will find courses to help you build exciting real-world projects and advanced full-stack web development.
Sources & Further Readings
1. Turnbull, D. (n.d.). Meteor Tutorial - A Complete Beginner's Guide to Meteor.js. Meteor Tutorial - A Complete Beginner's Guide to Meteor.js. Retrieved April 7, 2019, from http://meteortips.com/
2. Rauch, G. (2014, November 4). Guillermo Rauch. 7 Principles of Rich Web Applications. Retrieved April 7, 2019, from http://rauchg.com/2014/7-principles-of-rich-web-applications/#react-to-data-changes
3. Solanki, P. (2019, January ). Reasons Why Meteor.js is Regarded Best for Any Web Development Project. Retrieved April 7, 2019, from http://www.mindinventory.com/blog/benefits-of-choosing-meteor-js-for-start-up/
This article is accurate and true to the best of the author’s knowledge. Content is for informational or entertainment purposes only and does not substitute for personal counsel or professional advice in business, financial, legal, or technical matters.
© 2019 Lovelli Fuad