I have come to prefer compiling from source according to the instructions 
here:

https://stackoverflow.com/questions/27139323/npm-uninstalls-itself-on-npm-update

(note that I did not come up with this method, but I am reposting it here 
in case something happens to the link)

export NODE_PARENT=/some/desired/install/path_goes_here
export NODE_PARENT=/usr/local/bin/nodejs    # use this if you want to install 
as root (sudo)export NODE_PARENT=${HOME}/nodejs-v0.10.33  # use this if you 
want to install modules as yourself
export PATH=${NODE_PARENT}/bin:${PATH}export 
NODE_PATH=${NODE_PARENT}/lib/node_modules
./configure   --prefix=${NODE_PARENT}

make
make install

NODE_PARENT, NODE_PATH, and the alteration to your PATH should all go in 
your .bash_profile in order to persist between sessions. Also don't forget 
the --prefix flag with running the configure script!

This gives me node and anything I `npm install -g` in a directory that is 
local to my user profile (I put it in my Home) without having to use sudo 
and thus without running into the permissions problems I have had in the 
past when installing via binary to usr/bin. 

Once the latest node is installed from source I use n 
<https://www.npmjs.com/package/n> to manage other versions. 

On Tuesday, June 30, 2015 at 6:05:43 PM UTC-7, James Ramsfield wrote:
>
> Hi
>
> I have the followring question
>
> I'm have tried installing nodejs on ubuntu using the following command:
>
> sudo apt-get nodejs
>
> Problem is that it didnt install v0.12.5, but instead install an early 
> version of nodej (10.4 I think). So I'm im not sure if  'sudo apt-get nodejs
> is the correct way of installing nodejs on ubuntu 14.04. So my question is:
>
> What is the recommended way of installing nodejs on ubuntu 14.04?
>
> James
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/5749db87-6426-4fc2-bb7f-fee1603258c5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to