Ember-cli on ubuntu 14.04


#1

Hi all, I’m new to Ember and I’m trying to create new ember app using using ember-cli on ubuntu. For some reason the app is not created and I can’t see any error on screen. Anyone had such problem? Thanks!


#2

have you tried? sudo ember new app?


#3

Yep, tried to re-install ember-cli and update npm. Nothing helped.


#4

fixed by: sudo apt-get install nodejs instead sudo apt-get install node. Thanks :smile:


#5

A warning to all: this will work, but it is generally a very bad idea. The simple truth is that you shouldn’t install node with Synaptic, because it will mean requiring sudo to do basically anything in node. A much better strategy is to use nvm.

  1. wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.24.1/install.sh | bash
  2. Restart your terminal
  3. nvm install 0.10
  4. nvm use 0.10
  5. Do all of your node stuff sudo-free (npm install -g ember-cli, npm install, ember s, etc.)

Note that you’ll need to run nvm use 0.10 every time you restart your terminal. You could also use 0.12 or iojs, but not every add-on supports these right now (SASS being the biggie).

To uninstall node, I’ve found that these instructions work fine on 14.04 even though they say it’s for OSX.


#6

Let me disagree with you in this passage

When you have npm installed by a package manager, the only case you need to use sudo is a global installation of a gem. And in fact it is required only because npm needs to create symlink for the gem in /usr/bin, which is always available to write only for the root user.

It’s totally ok to use nodejs from the package manager, the only point you need to take into account is, as I said above, to install global gems with sudo. All other operations work without sudo, so ember new app-name is a correct call. I’d be concerning more about version of the nodejs from the synaptic, because by default it’s 0.10, which is pretty old for ember-cli


#7

nvm alias default 0.10 will set the default version for new terminals.


#8

Apologies, I mispoke. My point stands though- letting any rando who publishes to npm run scripts as a superuser on your machine is a bad idea.

Good call!! Missed that in the docs.


#9

You can change the npm prefix to something like "/home/$USER/npm" https://docs.npmjs.com/cli/prefix This way you’ll never need sudo for global packages. (Don’t forget to add the prefix bin dir to your PATH)


#10

Ok. Your solution:

  1. Change npm prefix to /home/$USER/npm
  2. Add the prefix bin dir to your PATH (what in fact equals to - modify one of your .bash* files)

My solution:

  1. Write sudo before npm when you install a global package.

Can you predict whose solution will be used more often? I believe you can and you know why.

To make it clear - I actually don’t do as I propose and I got your points, especially from Kyle

But (1) bower and ember-cli packages are not from rando, all other packages will be installed without sudo; (2) I don’t even see a problem when I do it in my development environment, for example, in a vagrant box. It’s not an absolute evil, as I understand you, guys, want to imagine it. It’s just a simpler solution in a suitable environment.