How to install Polymer 2.0

Noob question.

I want to experiment with building an app using polymer 2.0.
It seems as though it is possible to declare a dependency in package.json, but I haven’t had any luck getting that to work.

To install polymer locally, I would:
npm install -g polymer-cli@next

What should I be putting into the package.json file to achieve the same end?
Thanks

You could use Bower to install the components, with a project set up to serve them with Express as in https://glitch.com/edit/#!/cold-umbrella

Thanks! That looks like exactly what I need.

Out of curiosity, are the files - such as bower.json - Glitch specific, or are they NPM related? I am trying to work out what I should be reading to learn about this.

1 Like

bower.json is not Glitch specific, Bower is a package manager like NPM, but primarily for front-end resources (see https://bower.io). The only Glitch specific file in that project is watch.json, which tells the editor to look for changes to the bower.json file in addition to the package.json file it looks at by default (more deets about that at https://glitch.com/faq)

Thanks. One last question. When I install polymer on a stand alone machine, I can then run polymer init to create an application. Is there a way to do that through glitch? Or do I create it locally and then import it via GitHub?

We don’t provide a command line at the moment, so you could import it each time, or do that once and that could then act as a template which you then remix for subsequent projects.