How to Install Node.js without sudo access but with npm 1.3.10 installed?
I have little knowledge of Ubuntu 14.04.
I need to install Node.js. The Ubuntu I am using is a big system for an organization so I don't have sudo
access, but I found that npm 1.3.10 is installed.
I am looking for a sequence of commands to install Node.js into my user directory. I have downloaded Node.js
from here on nodejs.org (LTS version, 64 bit) in ~/Downloads/node-v8.9.1-linux-x64.tar.xz
. What do I do next?
software-installation nodejs npm
add a comment |
I have little knowledge of Ubuntu 14.04.
I need to install Node.js. The Ubuntu I am using is a big system for an organization so I don't have sudo
access, but I found that npm 1.3.10 is installed.
I am looking for a sequence of commands to install Node.js into my user directory. I have downloaded Node.js
from here on nodejs.org (LTS version, 64 bit) in ~/Downloads/node-v8.9.1-linux-x64.tar.xz
. What do I do next?
software-installation nodejs npm
Your company's hardware is NOT for you to install things outside of what you're authorized to do. Please contact your IT department instead of posting random things in the web.
– user692175
Dec 1 '17 at 3:05
2
@MichaelBay Node.js can also be installed locally without having to use sudo and without having to contact the IT department in order to get authorization to install Node.js globally.
– karel
Dec 1 '17 at 5:29
add a comment |
I have little knowledge of Ubuntu 14.04.
I need to install Node.js. The Ubuntu I am using is a big system for an organization so I don't have sudo
access, but I found that npm 1.3.10 is installed.
I am looking for a sequence of commands to install Node.js into my user directory. I have downloaded Node.js
from here on nodejs.org (LTS version, 64 bit) in ~/Downloads/node-v8.9.1-linux-x64.tar.xz
. What do I do next?
software-installation nodejs npm
I have little knowledge of Ubuntu 14.04.
I need to install Node.js. The Ubuntu I am using is a big system for an organization so I don't have sudo
access, but I found that npm 1.3.10 is installed.
I am looking for a sequence of commands to install Node.js into my user directory. I have downloaded Node.js
from here on nodejs.org (LTS version, 64 bit) in ~/Downloads/node-v8.9.1-linux-x64.tar.xz
. What do I do next?
software-installation nodejs npm
software-installation nodejs npm
edited Dec 1 '17 at 10:32
Zanna
51.1k13138242
51.1k13138242
asked Nov 30 '17 at 11:55
user5280911user5280911
16617
16617
Your company's hardware is NOT for you to install things outside of what you're authorized to do. Please contact your IT department instead of posting random things in the web.
– user692175
Dec 1 '17 at 3:05
2
@MichaelBay Node.js can also be installed locally without having to use sudo and without having to contact the IT department in order to get authorization to install Node.js globally.
– karel
Dec 1 '17 at 5:29
add a comment |
Your company's hardware is NOT for you to install things outside of what you're authorized to do. Please contact your IT department instead of posting random things in the web.
– user692175
Dec 1 '17 at 3:05
2
@MichaelBay Node.js can also be installed locally without having to use sudo and without having to contact the IT department in order to get authorization to install Node.js globally.
– karel
Dec 1 '17 at 5:29
Your company's hardware is NOT for you to install things outside of what you're authorized to do. Please contact your IT department instead of posting random things in the web.
– user692175
Dec 1 '17 at 3:05
Your company's hardware is NOT for you to install things outside of what you're authorized to do. Please contact your IT department instead of posting random things in the web.
– user692175
Dec 1 '17 at 3:05
2
2
@MichaelBay Node.js can also be installed locally without having to use sudo and without having to contact the IT department in order to get authorization to install Node.js globally.
– karel
Dec 1 '17 at 5:29
@MichaelBay Node.js can also be installed locally without having to use sudo and without having to contact the IT department in order to get authorization to install Node.js globally.
– karel
Dec 1 '17 at 5:29
add a comment |
3 Answers
3
active
oldest
votes
In order to install Node.js and npm locally without having to use sudo open the terminal and type:
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
wget -c http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install
wget -c https://www.npmjs.org/install.sh | sh
The curl package is not installed in Ubuntu by default. If you don't have curl installed on your system, replace all instances of curl
in the install.sh file with wget -c
and save the changes to the install.sh file before running it.
This will install node-v9.2.0 which is a later version of Node.js than the file you already downloaded.
Thank you so so much, karel. I not only know how to install Node.js, but also learnt a general method to install a software into my user folder from source. Only two things to mention, 1) first, I have an existing ~/.bashrc, so I added the path in geditor manually and re-login. 2) I don't understand the 6th command so I run them separately: first wget ... second tar -xzf ... and finally cd into the unzipped folder. I don't understand the last command either. Does it mean I download install.sh from that url and run it?
– user5280911
Dec 1 '17 at 8:15
What you did with existing ~/.bashrc is OK. Regarding the last command, it does download the install.sh file from the url and run it, in addition the install.sh file doesn't even need to have executable permissions because you are running the command as a regular user, not with sudo.
– karel
Dec 1 '17 at 8:35
1
I got it. Thank you. I'm sorry I cannot up-vote your answer because my reputation point is not enough, but I will do that once I can. Thank you again for your help.
– user5280911
Dec 1 '17 at 9:09
add a comment |
I workout this way - in 2 steps.
Step 1: Download and extract nodejs binaries
# create a directory where you want to install node js
mkdir ~/nodejs-latest
# download and extract nodejs binaries into the created directory
cd ~/nodejs-latest
wget -c http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
Step 2: Set PATH and source
# append the following lines to the ~/.bashrc file
export NODE_HOME=~/nodejs-latest
export PATH=$PATH:$NODE_HOME/bin
# refresh environment variables
source ~/.bashrc
You can then verify the nodejs installation with node --version
and npm --version
.
add a comment |
I like to use ubuntu groups to achieve this. It's quite simple.
First install nodejs and npm using apt-get
sudo apt-get update && sudo apt-get install nodejs npm
Figure out who is logged in i.e username, run following command to see it in terminal
whoami
You can see the list of groups you are assigned by using a very simple command, normally the first group is your username itself
groups
Run following to allow access to logged in user
sudo chmod 777 -R /usr/local && sudo chgrp $(whoami) -R /usr/local
Update npm and nodejs
npm install -g npm
You are allset, your user can run npm commands without sudo
You can also refer to npm throws error without sudo.
1
Modifying the standard permissions of the file system should be the last action.
– Carlos Dagorret
Feb 3 at 23:30
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%2f981799%2fhow-to-install-node-js-without-sudo-access-but-with-npm-1-3-10-installed%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
In order to install Node.js and npm locally without having to use sudo open the terminal and type:
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
wget -c http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install
wget -c https://www.npmjs.org/install.sh | sh
The curl package is not installed in Ubuntu by default. If you don't have curl installed on your system, replace all instances of curl
in the install.sh file with wget -c
and save the changes to the install.sh file before running it.
This will install node-v9.2.0 which is a later version of Node.js than the file you already downloaded.
Thank you so so much, karel. I not only know how to install Node.js, but also learnt a general method to install a software into my user folder from source. Only two things to mention, 1) first, I have an existing ~/.bashrc, so I added the path in geditor manually and re-login. 2) I don't understand the 6th command so I run them separately: first wget ... second tar -xzf ... and finally cd into the unzipped folder. I don't understand the last command either. Does it mean I download install.sh from that url and run it?
– user5280911
Dec 1 '17 at 8:15
What you did with existing ~/.bashrc is OK. Regarding the last command, it does download the install.sh file from the url and run it, in addition the install.sh file doesn't even need to have executable permissions because you are running the command as a regular user, not with sudo.
– karel
Dec 1 '17 at 8:35
1
I got it. Thank you. I'm sorry I cannot up-vote your answer because my reputation point is not enough, but I will do that once I can. Thank you again for your help.
– user5280911
Dec 1 '17 at 9:09
add a comment |
In order to install Node.js and npm locally without having to use sudo open the terminal and type:
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
wget -c http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install
wget -c https://www.npmjs.org/install.sh | sh
The curl package is not installed in Ubuntu by default. If you don't have curl installed on your system, replace all instances of curl
in the install.sh file with wget -c
and save the changes to the install.sh file before running it.
This will install node-v9.2.0 which is a later version of Node.js than the file you already downloaded.
Thank you so so much, karel. I not only know how to install Node.js, but also learnt a general method to install a software into my user folder from source. Only two things to mention, 1) first, I have an existing ~/.bashrc, so I added the path in geditor manually and re-login. 2) I don't understand the 6th command so I run them separately: first wget ... second tar -xzf ... and finally cd into the unzipped folder. I don't understand the last command either. Does it mean I download install.sh from that url and run it?
– user5280911
Dec 1 '17 at 8:15
What you did with existing ~/.bashrc is OK. Regarding the last command, it does download the install.sh file from the url and run it, in addition the install.sh file doesn't even need to have executable permissions because you are running the command as a regular user, not with sudo.
– karel
Dec 1 '17 at 8:35
1
I got it. Thank you. I'm sorry I cannot up-vote your answer because my reputation point is not enough, but I will do that once I can. Thank you again for your help.
– user5280911
Dec 1 '17 at 9:09
add a comment |
In order to install Node.js and npm locally without having to use sudo open the terminal and type:
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
wget -c http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install
wget -c https://www.npmjs.org/install.sh | sh
The curl package is not installed in Ubuntu by default. If you don't have curl installed on your system, replace all instances of curl
in the install.sh file with wget -c
and save the changes to the install.sh file before running it.
This will install node-v9.2.0 which is a later version of Node.js than the file you already downloaded.
In order to install Node.js and npm locally without having to use sudo open the terminal and type:
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
wget -c http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install
wget -c https://www.npmjs.org/install.sh | sh
The curl package is not installed in Ubuntu by default. If you don't have curl installed on your system, replace all instances of curl
in the install.sh file with wget -c
and save the changes to the install.sh file before running it.
This will install node-v9.2.0 which is a later version of Node.js than the file you already downloaded.
edited Oct 4 '18 at 13:08
David Goldfarb
1107
1107
answered Dec 1 '17 at 5:04
karelkarel
60.4k13131155
60.4k13131155
Thank you so so much, karel. I not only know how to install Node.js, but also learnt a general method to install a software into my user folder from source. Only two things to mention, 1) first, I have an existing ~/.bashrc, so I added the path in geditor manually and re-login. 2) I don't understand the 6th command so I run them separately: first wget ... second tar -xzf ... and finally cd into the unzipped folder. I don't understand the last command either. Does it mean I download install.sh from that url and run it?
– user5280911
Dec 1 '17 at 8:15
What you did with existing ~/.bashrc is OK. Regarding the last command, it does download the install.sh file from the url and run it, in addition the install.sh file doesn't even need to have executable permissions because you are running the command as a regular user, not with sudo.
– karel
Dec 1 '17 at 8:35
1
I got it. Thank you. I'm sorry I cannot up-vote your answer because my reputation point is not enough, but I will do that once I can. Thank you again for your help.
– user5280911
Dec 1 '17 at 9:09
add a comment |
Thank you so so much, karel. I not only know how to install Node.js, but also learnt a general method to install a software into my user folder from source. Only two things to mention, 1) first, I have an existing ~/.bashrc, so I added the path in geditor manually and re-login. 2) I don't understand the 6th command so I run them separately: first wget ... second tar -xzf ... and finally cd into the unzipped folder. I don't understand the last command either. Does it mean I download install.sh from that url and run it?
– user5280911
Dec 1 '17 at 8:15
What you did with existing ~/.bashrc is OK. Regarding the last command, it does download the install.sh file from the url and run it, in addition the install.sh file doesn't even need to have executable permissions because you are running the command as a regular user, not with sudo.
– karel
Dec 1 '17 at 8:35
1
I got it. Thank you. I'm sorry I cannot up-vote your answer because my reputation point is not enough, but I will do that once I can. Thank you again for your help.
– user5280911
Dec 1 '17 at 9:09
Thank you so so much, karel. I not only know how to install Node.js, but also learnt a general method to install a software into my user folder from source. Only two things to mention, 1) first, I have an existing ~/.bashrc, so I added the path in geditor manually and re-login. 2) I don't understand the 6th command so I run them separately: first wget ... second tar -xzf ... and finally cd into the unzipped folder. I don't understand the last command either. Does it mean I download install.sh from that url and run it?
– user5280911
Dec 1 '17 at 8:15
Thank you so so much, karel. I not only know how to install Node.js, but also learnt a general method to install a software into my user folder from source. Only two things to mention, 1) first, I have an existing ~/.bashrc, so I added the path in geditor manually and re-login. 2) I don't understand the 6th command so I run them separately: first wget ... second tar -xzf ... and finally cd into the unzipped folder. I don't understand the last command either. Does it mean I download install.sh from that url and run it?
– user5280911
Dec 1 '17 at 8:15
What you did with existing ~/.bashrc is OK. Regarding the last command, it does download the install.sh file from the url and run it, in addition the install.sh file doesn't even need to have executable permissions because you are running the command as a regular user, not with sudo.
– karel
Dec 1 '17 at 8:35
What you did with existing ~/.bashrc is OK. Regarding the last command, it does download the install.sh file from the url and run it, in addition the install.sh file doesn't even need to have executable permissions because you are running the command as a regular user, not with sudo.
– karel
Dec 1 '17 at 8:35
1
1
I got it. Thank you. I'm sorry I cannot up-vote your answer because my reputation point is not enough, but I will do that once I can. Thank you again for your help.
– user5280911
Dec 1 '17 at 9:09
I got it. Thank you. I'm sorry I cannot up-vote your answer because my reputation point is not enough, but I will do that once I can. Thank you again for your help.
– user5280911
Dec 1 '17 at 9:09
add a comment |
I workout this way - in 2 steps.
Step 1: Download and extract nodejs binaries
# create a directory where you want to install node js
mkdir ~/nodejs-latest
# download and extract nodejs binaries into the created directory
cd ~/nodejs-latest
wget -c http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
Step 2: Set PATH and source
# append the following lines to the ~/.bashrc file
export NODE_HOME=~/nodejs-latest
export PATH=$PATH:$NODE_HOME/bin
# refresh environment variables
source ~/.bashrc
You can then verify the nodejs installation with node --version
and npm --version
.
add a comment |
I workout this way - in 2 steps.
Step 1: Download and extract nodejs binaries
# create a directory where you want to install node js
mkdir ~/nodejs-latest
# download and extract nodejs binaries into the created directory
cd ~/nodejs-latest
wget -c http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
Step 2: Set PATH and source
# append the following lines to the ~/.bashrc file
export NODE_HOME=~/nodejs-latest
export PATH=$PATH:$NODE_HOME/bin
# refresh environment variables
source ~/.bashrc
You can then verify the nodejs installation with node --version
and npm --version
.
add a comment |
I workout this way - in 2 steps.
Step 1: Download and extract nodejs binaries
# create a directory where you want to install node js
mkdir ~/nodejs-latest
# download and extract nodejs binaries into the created directory
cd ~/nodejs-latest
wget -c http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
Step 2: Set PATH and source
# append the following lines to the ~/.bashrc file
export NODE_HOME=~/nodejs-latest
export PATH=$PATH:$NODE_HOME/bin
# refresh environment variables
source ~/.bashrc
You can then verify the nodejs installation with node --version
and npm --version
.
I workout this way - in 2 steps.
Step 1: Download and extract nodejs binaries
# create a directory where you want to install node js
mkdir ~/nodejs-latest
# download and extract nodejs binaries into the created directory
cd ~/nodejs-latest
wget -c http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
Step 2: Set PATH and source
# append the following lines to the ~/.bashrc file
export NODE_HOME=~/nodejs-latest
export PATH=$PATH:$NODE_HOME/bin
# refresh environment variables
source ~/.bashrc
You can then verify the nodejs installation with node --version
and npm --version
.
answered Oct 22 '18 at 14:56
RamvigneshRamvignesh
82251327
82251327
add a comment |
add a comment |
I like to use ubuntu groups to achieve this. It's quite simple.
First install nodejs and npm using apt-get
sudo apt-get update && sudo apt-get install nodejs npm
Figure out who is logged in i.e username, run following command to see it in terminal
whoami
You can see the list of groups you are assigned by using a very simple command, normally the first group is your username itself
groups
Run following to allow access to logged in user
sudo chmod 777 -R /usr/local && sudo chgrp $(whoami) -R /usr/local
Update npm and nodejs
npm install -g npm
You are allset, your user can run npm commands without sudo
You can also refer to npm throws error without sudo.
1
Modifying the standard permissions of the file system should be the last action.
– Carlos Dagorret
Feb 3 at 23:30
add a comment |
I like to use ubuntu groups to achieve this. It's quite simple.
First install nodejs and npm using apt-get
sudo apt-get update && sudo apt-get install nodejs npm
Figure out who is logged in i.e username, run following command to see it in terminal
whoami
You can see the list of groups you are assigned by using a very simple command, normally the first group is your username itself
groups
Run following to allow access to logged in user
sudo chmod 777 -R /usr/local && sudo chgrp $(whoami) -R /usr/local
Update npm and nodejs
npm install -g npm
You are allset, your user can run npm commands without sudo
You can also refer to npm throws error without sudo.
1
Modifying the standard permissions of the file system should be the last action.
– Carlos Dagorret
Feb 3 at 23:30
add a comment |
I like to use ubuntu groups to achieve this. It's quite simple.
First install nodejs and npm using apt-get
sudo apt-get update && sudo apt-get install nodejs npm
Figure out who is logged in i.e username, run following command to see it in terminal
whoami
You can see the list of groups you are assigned by using a very simple command, normally the first group is your username itself
groups
Run following to allow access to logged in user
sudo chmod 777 -R /usr/local && sudo chgrp $(whoami) -R /usr/local
Update npm and nodejs
npm install -g npm
You are allset, your user can run npm commands without sudo
You can also refer to npm throws error without sudo.
I like to use ubuntu groups to achieve this. It's quite simple.
First install nodejs and npm using apt-get
sudo apt-get update && sudo apt-get install nodejs npm
Figure out who is logged in i.e username, run following command to see it in terminal
whoami
You can see the list of groups you are assigned by using a very simple command, normally the first group is your username itself
groups
Run following to allow access to logged in user
sudo chmod 777 -R /usr/local && sudo chgrp $(whoami) -R /usr/local
Update npm and nodejs
npm install -g npm
You are allset, your user can run npm commands without sudo
You can also refer to npm throws error without sudo.
edited Feb 7 at 1:47
Pierre.Vriens
1,13761216
1,13761216
answered Feb 3 at 22:07
Gitesh DalalGitesh Dalal
11
11
1
Modifying the standard permissions of the file system should be the last action.
– Carlos Dagorret
Feb 3 at 23:30
add a comment |
1
Modifying the standard permissions of the file system should be the last action.
– Carlos Dagorret
Feb 3 at 23:30
1
1
Modifying the standard permissions of the file system should be the last action.
– Carlos Dagorret
Feb 3 at 23:30
Modifying the standard permissions of the file system should be the last action.
– Carlos Dagorret
Feb 3 at 23:30
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%2f981799%2fhow-to-install-node-js-without-sudo-access-but-with-npm-1-3-10-installed%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
Your company's hardware is NOT for you to install things outside of what you're authorized to do. Please contact your IT department instead of posting random things in the web.
– user692175
Dec 1 '17 at 3:05
2
@MichaelBay Node.js can also be installed locally without having to use sudo and without having to contact the IT department in order to get authorization to install Node.js globally.
– karel
Dec 1 '17 at 5:29