Join Joe Marini for an in-depth discussion in this video Set up the development environment, part of Learning Polymer.
- [Instructor] Before we begin the course, we'll need to ensure that the development environment is set up correctly. So open a terminal window on your OS. Here on my Mac, I'm going to use the Terminal App, but it might be different for you. On Windows, for example, it's called the Command Prompt. So type the command, node --version. If you see a version number and it is at least 6.10 then you're all set. You will also need to have npm installed. So type npm --version, and make sure that you don't get an error code here.
If you see an error, or have an older version of node, you'll need to either install Node and npm, or update them. You can install Node.js and Node Package Manager by visiting the nodejs.org website and npmjs.com and following the relevant instructions for your platform. So once you have Node and npm installed, you'll need to install the Polymer tools. To do this, use your terminal program to run the command npminstall-g for global, and then type polymer-cli.
Now, I have already done this. But you'll probably need to run this command to get Polymer onto your system. So, go ahead and run this command, and then to make sure that this command worked, what we're going to do is run polymer --version. And make sure that you get a result that's not an error message. Now in this case, you can see that the version of the polymer command line tools that I'm using is 1.3.1. Now to be clear, that's not the version of the polymer library. It's just the version of the tool set.
Next, we'll install the Bower Package Management Tool. So as of this recording, polymer uses the Bower tool to manage the installation of Polymer Web Components. And don't pay too much attention to this. By the time you watch this video, other management tools like Yarn or npm might also be used to install Polymer components. All you really need to know is that this tool is one way of managing Polymer components on your system. And you can learn more about Bower by going to the website at bower.io.
To install it, you're going to run the command npm install, and once again -g for global, and then type bower. Now, again, I've done this on my system already, so you'll probably need to do this for your system, so go ahead and run that command. Now the good news is that I've already installed all of the Polymer components that the course uses in the exercise files folder. I've also installed several extra components that the course doesn't need, but that you might want to try out. So, you might not even need this tool for now.
Once you've installed the correct tools for your platform, you're ready to proceed with the rest of the course.
- What is Polymer?
- The Polymer command line
- Using components in an app
- The web components catalog
- Building a web component
- Defining component structure and appearance
- Scaffolding a Polymer project
- Creating an element
- Polymer data binding