A guide to install Ionic 2 in Ubuntu 14.04

I’m always nervous when I see people recommending “hey, just run this random shell script from somewhere on the web as root”. I think it’s a bad habit in general, and completely unneeded here. nvm will allow you to install multiple versions of nodejs without needing root privileges at all.

1 Like

I think it is time I give up. I tired cleaning nodejs and npm using – purge autoremove , removed ionic and cordova. Reinstalled again. No luck so far.

The latest issue is npm not getting installed

If someone can help using Team Viewer, it would be great.

@rapropos,

It’s good to be cautious, but in this case it’s, in fact, instructions from the official nodejs site. Here is the link:

https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions

1 Like

I know. I think they’re no good, very bad, brain-dead instructions.

  • One of the primary reasons to have package managers in the first place is so that the system knows which files belong to which packages. This gets subverted here. You don’t know how to clean things up. Maybe this script overwrites existing managed files. Maybe it throws cruft into /usr/local that will jump ahead of other things on your PATH. Very difficult to diagnose and remedy.

  • Modern package ecosystems have authentication. I did some of the early work on Gentoo’s implementation of this. Distros have trusted signing keys, and you can be relatively certain that a signed package or build script is authentic. This gets subverted here. You have absolutely no protection against or even awareness of the authenticity of this script that you are running as root. Maybe there’s a rogue mirror with a trojaned version.

  • Installing nodejs as root is simply not necessary. nvm does an excellent job of dealing with all this, including having the ability to install multiple versions side-by-side. You know where everything is (~/.nvm) and can clean it out easily. Anything you do won’t affect any other users of the machine.