mardi 17 novembre 2015

Guidance on how to setup the basic “Components” example from the official EmberJS homepage

My background is in old-school web development and LAMP stack development. Meaning I can code HTML, PHP, CSS and JavaScript with ease. But have decided I need to be a bit “modern” as far as client side tech goes and am teaching myself EmberJS on my Mac OS X 10.9.5 machine. Core versions are as follows:

  • Ember CLI version: 1.13.12
  • Node JS version: 4.2.2
  • NPM (Node Package Manager) version: 2.14.10
  • Watchman: 4.1.0

The basic “Auto-Updating Handlebars Templates” example on the official EmberJS site works, but I am lost on the “Components” example on the EmberJS homepage.

My process so far as been to init a new app like this:

ember new new-app

Then once that is done and the folder structure is built, I am simply creating new documents based on that “Components” example as follows; see screenshot for an example:

  • templates/components/gravatar-image.js
  • templates/application.hbs
  • templates/components/gravatar-image.hbs

Screenshot of my EmberJS example test app.

Since I am new to EmberJS I am assuming this is the proper folder structure for this simple app example since templates/application.hbs is the only place I am seeing application.hbs installed and all of the paths on that simple homepage example are relative to some root, correct? But when I attempt to run it like this:

ember serve

It consistently fails with the following error:

version: 1.13.12
Livereload server on http://localhost:49152
Serving on http://localhost:4200/
EEXIST: file already exists, symlink '/path/to/new-app/tmp/template_compiler-input_base_path-http://ift.tt/1HVJ1YH' -> '/Applications/MAMP/htdocs/Ember-Sandbox/tmp/template_compiler-output_path-http://ift.tt/1HXFqnB'

Doing some basic online searches led me to believe it might require me to delete cached files and dependencies like this:

rm -rf node_modules tmp dist bower_components

And then reinstall them like this:

npm install && bower install

But even after that’s done, the same EEXIST: file already exists, symlink… pops up again.

What am I doing wrong? And what can I do to get this very basic example up and running?

Aucun commentaire:

Enregistrer un commentaire