How to upgrade/install newest version of nodejs on Ubuntu 14.04
I have been working an hour for this.
Taken from their official documentation :
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
However, its never working for me. I have tried to clear the npm cache
, even uninstall it and run both command again. Its still not working. I keep getting version 0.10.25
I run :
grep -h ^deb /etc/apt/sources.list /etc/apt/sources.list.d/*
And this is what i get :
deb http://id.archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty main restricted
deb http://id.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb http://id.archive.ubuntu.com/ubuntu/ trusty universe
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty universe
deb http://id.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb http://id.archive.ubuntu.com/ubuntu/ trusty multiverse
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty multiverse
deb http://id.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb http://id.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu trusty-security main restricted
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse
deb http://extras.ubuntu.com/ubuntu trusty main
deb-src http://extras.ubuntu.com/ubuntu trusty main
deb http://ppa.launchpad.net/cpug-devs/ppa/ubuntu saucy main
deb http://ppa.launchpad.net/cwchien/gradle/ubuntu saucy main
deb http://ppa.launchpad.net/dominik-stadler/subversion-1.7/ubuntu trusty main
deb http://ppa.launchpad.net/dominik-stadler/subversion-1.7/ubuntu trusty main
deb http://ppa.launchpad.net/dominik-stadler/subversion-1.8/ubuntu trusty main
deb http://linux.dropbox.com/ubuntu saucy main
deb http://dl.google.com/linux/chrome/deb/ stable main
deb http://dl.google.com/linux/chrome/deb/ stable main
deb http://dl.google.com/linux/chrome/deb/ stable main
deb http://ppa.launchpad.net/plushuang-tw/uget-stable/ubuntu saucy main
deb [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
deb-src [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
deb [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
deb-src [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu trusty main
deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu trusty main
deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
It seems the nodejs
is not on the list.
What should i do? Please kindly help me
14.04 nodejs curl
add a comment |
I have been working an hour for this.
Taken from their official documentation :
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
However, its never working for me. I have tried to clear the npm cache
, even uninstall it and run both command again. Its still not working. I keep getting version 0.10.25
I run :
grep -h ^deb /etc/apt/sources.list /etc/apt/sources.list.d/*
And this is what i get :
deb http://id.archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty main restricted
deb http://id.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb http://id.archive.ubuntu.com/ubuntu/ trusty universe
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty universe
deb http://id.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb http://id.archive.ubuntu.com/ubuntu/ trusty multiverse
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty multiverse
deb http://id.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb http://id.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu trusty-security main restricted
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse
deb http://extras.ubuntu.com/ubuntu trusty main
deb-src http://extras.ubuntu.com/ubuntu trusty main
deb http://ppa.launchpad.net/cpug-devs/ppa/ubuntu saucy main
deb http://ppa.launchpad.net/cwchien/gradle/ubuntu saucy main
deb http://ppa.launchpad.net/dominik-stadler/subversion-1.7/ubuntu trusty main
deb http://ppa.launchpad.net/dominik-stadler/subversion-1.7/ubuntu trusty main
deb http://ppa.launchpad.net/dominik-stadler/subversion-1.8/ubuntu trusty main
deb http://linux.dropbox.com/ubuntu saucy main
deb http://dl.google.com/linux/chrome/deb/ stable main
deb http://dl.google.com/linux/chrome/deb/ stable main
deb http://dl.google.com/linux/chrome/deb/ stable main
deb http://ppa.launchpad.net/plushuang-tw/uget-stable/ubuntu saucy main
deb [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
deb-src [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
deb [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
deb-src [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu trusty main
deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu trusty main
deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
It seems the nodejs
is not on the list.
What should i do? Please kindly help me
14.04 nodejs curl
add a comment |
I have been working an hour for this.
Taken from their official documentation :
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
However, its never working for me. I have tried to clear the npm cache
, even uninstall it and run both command again. Its still not working. I keep getting version 0.10.25
I run :
grep -h ^deb /etc/apt/sources.list /etc/apt/sources.list.d/*
And this is what i get :
deb http://id.archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty main restricted
deb http://id.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb http://id.archive.ubuntu.com/ubuntu/ trusty universe
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty universe
deb http://id.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb http://id.archive.ubuntu.com/ubuntu/ trusty multiverse
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty multiverse
deb http://id.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb http://id.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu trusty-security main restricted
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse
deb http://extras.ubuntu.com/ubuntu trusty main
deb-src http://extras.ubuntu.com/ubuntu trusty main
deb http://ppa.launchpad.net/cpug-devs/ppa/ubuntu saucy main
deb http://ppa.launchpad.net/cwchien/gradle/ubuntu saucy main
deb http://ppa.launchpad.net/dominik-stadler/subversion-1.7/ubuntu trusty main
deb http://ppa.launchpad.net/dominik-stadler/subversion-1.7/ubuntu trusty main
deb http://ppa.launchpad.net/dominik-stadler/subversion-1.8/ubuntu trusty main
deb http://linux.dropbox.com/ubuntu saucy main
deb http://dl.google.com/linux/chrome/deb/ stable main
deb http://dl.google.com/linux/chrome/deb/ stable main
deb http://dl.google.com/linux/chrome/deb/ stable main
deb http://ppa.launchpad.net/plushuang-tw/uget-stable/ubuntu saucy main
deb [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
deb-src [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
deb [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
deb-src [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu trusty main
deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu trusty main
deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
It seems the nodejs
is not on the list.
What should i do? Please kindly help me
14.04 nodejs curl
I have been working an hour for this.
Taken from their official documentation :
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
However, its never working for me. I have tried to clear the npm cache
, even uninstall it and run both command again. Its still not working. I keep getting version 0.10.25
I run :
grep -h ^deb /etc/apt/sources.list /etc/apt/sources.list.d/*
And this is what i get :
deb http://id.archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty main restricted
deb http://id.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb http://id.archive.ubuntu.com/ubuntu/ trusty universe
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty universe
deb http://id.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb http://id.archive.ubuntu.com/ubuntu/ trusty multiverse
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty multiverse
deb http://id.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb http://id.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://id.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu trusty-security main restricted
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse
deb http://extras.ubuntu.com/ubuntu trusty main
deb-src http://extras.ubuntu.com/ubuntu trusty main
deb http://ppa.launchpad.net/cpug-devs/ppa/ubuntu saucy main
deb http://ppa.launchpad.net/cwchien/gradle/ubuntu saucy main
deb http://ppa.launchpad.net/dominik-stadler/subversion-1.7/ubuntu trusty main
deb http://ppa.launchpad.net/dominik-stadler/subversion-1.7/ubuntu trusty main
deb http://ppa.launchpad.net/dominik-stadler/subversion-1.8/ubuntu trusty main
deb http://linux.dropbox.com/ubuntu saucy main
deb http://dl.google.com/linux/chrome/deb/ stable main
deb http://dl.google.com/linux/chrome/deb/ stable main
deb http://dl.google.com/linux/chrome/deb/ stable main
deb http://ppa.launchpad.net/plushuang-tw/uget-stable/ubuntu saucy main
deb [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
deb-src [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
deb [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
deb-src [arch=amd64,i386] http://repo.steampowered.com/steam/ precise steam
deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu trusty main
deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu trusty main
deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
It seems the nodejs
is not on the list.
What should i do? Please kindly help me
14.04 nodejs curl
14.04 nodejs curl
asked Nov 7 '15 at 15:42
Blaze TamaBlaze Tama
37641326
37641326
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Below are the steps to install Node.js from source (OSX/linux)
NOTE - this installs Node.js which gives you both node as well as npm, they come together per release.
to start fresh remove prior node and npm installs as well as these :
sudo mv ~/.npmrc ~/.npmrc_ignore
sudo mv ~/.npm ~/.npm_ignore
sudo mv ~/tmp ~/tmp_ignore
sudo mv ~/.npm-init.js ~/.npm-init.js_ignore
download source from : http://nodejs.org/download/
cd node-v5.0.0 # <-- or whatever download expands to
You may/should issue all following cmds as yourself NOT root (sudo)
Pick one of these NODE_PARENT locations to define where node gets installed into :
# export NODE_PARENT=/some/desired/install/path_goes_here
# export NODE_PARENT=/usr/local/bin/nodejs # use this ONLY if you MUST install as root (sudo)
export NODE_PARENT=${HOME}/node-v5.0.0 # Recommended - owned by you NOT root
export PATH=${NODE_PARENT}/bin:${PATH} # jack up PATH for executables
export NODE_PATH=${NODE_PARENT}/lib/node_modules # so node itself can find its modules dir
./configure --prefix=${NODE_PARENT}
make
make install
which puts it into dir defined by above --prefix
when you use syntax : npm install -g some_cool_module the -g for global installs it into dir $NODE_PATH and not your $PWD
IMPORTANT - put above three export xxx=yyy commands into your ~/.bashrc or some such to persist these environment variable changes
On subsequent updates to Nodejs, just update your ~/.bashrc with new release name in your NODE_PARENT env var , then source this ~/.bashrc and simply issue the configure/make/install as above
If you had a prior install of node you may want to copy over previously installed modules into new location :
~/node-v5.0.0/lib/node_modules/
or do fresh module installs using npm install -g xxxx
add a comment |
I finally used the unofficial/outdated way :
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
sudo ln -sf /usr/local/n/versions/node/<VERSION>/bin/node /usr/bin/node
Taken from :
How can I update my nodeJS to the latest version?
However this make my node -v
and my nodejs -v
have different version. The nodejs -v
still return outdated version. I dont know if this have any effect yet.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f695138%2fhow-to-upgrade-install-newest-version-of-nodejs-on-ubuntu-14-04%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Below are the steps to install Node.js from source (OSX/linux)
NOTE - this installs Node.js which gives you both node as well as npm, they come together per release.
to start fresh remove prior node and npm installs as well as these :
sudo mv ~/.npmrc ~/.npmrc_ignore
sudo mv ~/.npm ~/.npm_ignore
sudo mv ~/tmp ~/tmp_ignore
sudo mv ~/.npm-init.js ~/.npm-init.js_ignore
download source from : http://nodejs.org/download/
cd node-v5.0.0 # <-- or whatever download expands to
You may/should issue all following cmds as yourself NOT root (sudo)
Pick one of these NODE_PARENT locations to define where node gets installed into :
# export NODE_PARENT=/some/desired/install/path_goes_here
# export NODE_PARENT=/usr/local/bin/nodejs # use this ONLY if you MUST install as root (sudo)
export NODE_PARENT=${HOME}/node-v5.0.0 # Recommended - owned by you NOT root
export PATH=${NODE_PARENT}/bin:${PATH} # jack up PATH for executables
export NODE_PATH=${NODE_PARENT}/lib/node_modules # so node itself can find its modules dir
./configure --prefix=${NODE_PARENT}
make
make install
which puts it into dir defined by above --prefix
when you use syntax : npm install -g some_cool_module the -g for global installs it into dir $NODE_PATH and not your $PWD
IMPORTANT - put above three export xxx=yyy commands into your ~/.bashrc or some such to persist these environment variable changes
On subsequent updates to Nodejs, just update your ~/.bashrc with new release name in your NODE_PARENT env var , then source this ~/.bashrc and simply issue the configure/make/install as above
If you had a prior install of node you may want to copy over previously installed modules into new location :
~/node-v5.0.0/lib/node_modules/
or do fresh module installs using npm install -g xxxx
add a comment |
Below are the steps to install Node.js from source (OSX/linux)
NOTE - this installs Node.js which gives you both node as well as npm, they come together per release.
to start fresh remove prior node and npm installs as well as these :
sudo mv ~/.npmrc ~/.npmrc_ignore
sudo mv ~/.npm ~/.npm_ignore
sudo mv ~/tmp ~/tmp_ignore
sudo mv ~/.npm-init.js ~/.npm-init.js_ignore
download source from : http://nodejs.org/download/
cd node-v5.0.0 # <-- or whatever download expands to
You may/should issue all following cmds as yourself NOT root (sudo)
Pick one of these NODE_PARENT locations to define where node gets installed into :
# export NODE_PARENT=/some/desired/install/path_goes_here
# export NODE_PARENT=/usr/local/bin/nodejs # use this ONLY if you MUST install as root (sudo)
export NODE_PARENT=${HOME}/node-v5.0.0 # Recommended - owned by you NOT root
export PATH=${NODE_PARENT}/bin:${PATH} # jack up PATH for executables
export NODE_PATH=${NODE_PARENT}/lib/node_modules # so node itself can find its modules dir
./configure --prefix=${NODE_PARENT}
make
make install
which puts it into dir defined by above --prefix
when you use syntax : npm install -g some_cool_module the -g for global installs it into dir $NODE_PATH and not your $PWD
IMPORTANT - put above three export xxx=yyy commands into your ~/.bashrc or some such to persist these environment variable changes
On subsequent updates to Nodejs, just update your ~/.bashrc with new release name in your NODE_PARENT env var , then source this ~/.bashrc and simply issue the configure/make/install as above
If you had a prior install of node you may want to copy over previously installed modules into new location :
~/node-v5.0.0/lib/node_modules/
or do fresh module installs using npm install -g xxxx
add a comment |
Below are the steps to install Node.js from source (OSX/linux)
NOTE - this installs Node.js which gives you both node as well as npm, they come together per release.
to start fresh remove prior node and npm installs as well as these :
sudo mv ~/.npmrc ~/.npmrc_ignore
sudo mv ~/.npm ~/.npm_ignore
sudo mv ~/tmp ~/tmp_ignore
sudo mv ~/.npm-init.js ~/.npm-init.js_ignore
download source from : http://nodejs.org/download/
cd node-v5.0.0 # <-- or whatever download expands to
You may/should issue all following cmds as yourself NOT root (sudo)
Pick one of these NODE_PARENT locations to define where node gets installed into :
# export NODE_PARENT=/some/desired/install/path_goes_here
# export NODE_PARENT=/usr/local/bin/nodejs # use this ONLY if you MUST install as root (sudo)
export NODE_PARENT=${HOME}/node-v5.0.0 # Recommended - owned by you NOT root
export PATH=${NODE_PARENT}/bin:${PATH} # jack up PATH for executables
export NODE_PATH=${NODE_PARENT}/lib/node_modules # so node itself can find its modules dir
./configure --prefix=${NODE_PARENT}
make
make install
which puts it into dir defined by above --prefix
when you use syntax : npm install -g some_cool_module the -g for global installs it into dir $NODE_PATH and not your $PWD
IMPORTANT - put above three export xxx=yyy commands into your ~/.bashrc or some such to persist these environment variable changes
On subsequent updates to Nodejs, just update your ~/.bashrc with new release name in your NODE_PARENT env var , then source this ~/.bashrc and simply issue the configure/make/install as above
If you had a prior install of node you may want to copy over previously installed modules into new location :
~/node-v5.0.0/lib/node_modules/
or do fresh module installs using npm install -g xxxx
Below are the steps to install Node.js from source (OSX/linux)
NOTE - this installs Node.js which gives you both node as well as npm, they come together per release.
to start fresh remove prior node and npm installs as well as these :
sudo mv ~/.npmrc ~/.npmrc_ignore
sudo mv ~/.npm ~/.npm_ignore
sudo mv ~/tmp ~/tmp_ignore
sudo mv ~/.npm-init.js ~/.npm-init.js_ignore
download source from : http://nodejs.org/download/
cd node-v5.0.0 # <-- or whatever download expands to
You may/should issue all following cmds as yourself NOT root (sudo)
Pick one of these NODE_PARENT locations to define where node gets installed into :
# export NODE_PARENT=/some/desired/install/path_goes_here
# export NODE_PARENT=/usr/local/bin/nodejs # use this ONLY if you MUST install as root (sudo)
export NODE_PARENT=${HOME}/node-v5.0.0 # Recommended - owned by you NOT root
export PATH=${NODE_PARENT}/bin:${PATH} # jack up PATH for executables
export NODE_PATH=${NODE_PARENT}/lib/node_modules # so node itself can find its modules dir
./configure --prefix=${NODE_PARENT}
make
make install
which puts it into dir defined by above --prefix
when you use syntax : npm install -g some_cool_module the -g for global installs it into dir $NODE_PATH and not your $PWD
IMPORTANT - put above three export xxx=yyy commands into your ~/.bashrc or some such to persist these environment variable changes
On subsequent updates to Nodejs, just update your ~/.bashrc with new release name in your NODE_PARENT env var , then source this ~/.bashrc and simply issue the configure/make/install as above
If you had a prior install of node you may want to copy over previously installed modules into new location :
~/node-v5.0.0/lib/node_modules/
or do fresh module installs using npm install -g xxxx
answered Nov 7 '15 at 15:55
Scott StenslandScott Stensland
4,84242242
4,84242242
add a comment |
add a comment |
I finally used the unofficial/outdated way :
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
sudo ln -sf /usr/local/n/versions/node/<VERSION>/bin/node /usr/bin/node
Taken from :
How can I update my nodeJS to the latest version?
However this make my node -v
and my nodejs -v
have different version. The nodejs -v
still return outdated version. I dont know if this have any effect yet.
add a comment |
I finally used the unofficial/outdated way :
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
sudo ln -sf /usr/local/n/versions/node/<VERSION>/bin/node /usr/bin/node
Taken from :
How can I update my nodeJS to the latest version?
However this make my node -v
and my nodejs -v
have different version. The nodejs -v
still return outdated version. I dont know if this have any effect yet.
add a comment |
I finally used the unofficial/outdated way :
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
sudo ln -sf /usr/local/n/versions/node/<VERSION>/bin/node /usr/bin/node
Taken from :
How can I update my nodeJS to the latest version?
However this make my node -v
and my nodejs -v
have different version. The nodejs -v
still return outdated version. I dont know if this have any effect yet.
I finally used the unofficial/outdated way :
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
sudo ln -sf /usr/local/n/versions/node/<VERSION>/bin/node /usr/bin/node
Taken from :
How can I update my nodeJS to the latest version?
However this make my node -v
and my nodejs -v
have different version. The nodejs -v
still return outdated version. I dont know if this have any effect yet.
edited Apr 13 '17 at 12:25
Community♦
1
1
answered Nov 7 '15 at 16:18
Blaze TamaBlaze Tama
37641326
37641326
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f695138%2fhow-to-upgrade-install-newest-version-of-nodejs-on-ubuntu-14-04%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown