What is the recommended place to install nodejs and mongodb in ubuntu 16.04 LTS?












0















I was trying to install node js in my Ubuntu 16.04 LTS , First I have downloaded latest distribution from Nodejs_Official_Page_Link .It got downloaded at my Downloads folder.then I have copied it from Download folder to /usr/local/ Directory through following command:



sudo cp -r node-v9.11.1-linux-x64 /usr/local/


After that I have checked my /usr/local/ Directory and it showed me a folder name node-v9.11.1-linux-x64



After that I have tried to set the path through following command:



sudo nano /etc/environment


Then I have added :/usr/local/node-v9.11.1-linux-x64/bin in PATH



then I checked it through node --version and it showed me v9.11.1
& for npm --version it is 5.6.0



then I tried to run npm i -g node-static and it said permission error ,try it as root.I know it can be done with sudo then.



So my question is that /usr/local/ a correct choice to install Node-js or should I install it somewhere else?



Further I also want to know what is the recommended place to install mongodb?I am new to Ubuntu so want to go with the recommended/safe practices suggested by experienced developers.Thankyou!










share|improve this question

























  • the recommended way for mongodb is sudo apt-get install mongodb

    – pim
    Apr 18 '18 at 14:19













  • For Node.js, you can use their repository. See this: linuxuprising.com/2018/04/… it explains installing from their repository as well as setting the PATH correctly.

    – Logix
    Apr 18 '18 at 19:18











  • I'd definitely recommend installing via supported packages rather than copying files into /usr/local manually. For MongoDB: docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu. For Node: github.com/nodesource/distributions#debinstall.

    – Stennie
    Apr 19 '18 at 7:00











  • @Stennie I know it would be easy to install through packages but as I have already installed it by copying it to /usr/local directory so want to resolve this permission issue .I first thought as through sudo it will be done but it didn't work with sudo so can you please suggest me how to resolve this permission issue , I tried following command and it didn't work : sudo npm i -g node-static which responded as sudo: npm: command not found

    – user716691
    May 6 '18 at 10:08


















0















I was trying to install node js in my Ubuntu 16.04 LTS , First I have downloaded latest distribution from Nodejs_Official_Page_Link .It got downloaded at my Downloads folder.then I have copied it from Download folder to /usr/local/ Directory through following command:



sudo cp -r node-v9.11.1-linux-x64 /usr/local/


After that I have checked my /usr/local/ Directory and it showed me a folder name node-v9.11.1-linux-x64



After that I have tried to set the path through following command:



sudo nano /etc/environment


Then I have added :/usr/local/node-v9.11.1-linux-x64/bin in PATH



then I checked it through node --version and it showed me v9.11.1
& for npm --version it is 5.6.0



then I tried to run npm i -g node-static and it said permission error ,try it as root.I know it can be done with sudo then.



So my question is that /usr/local/ a correct choice to install Node-js or should I install it somewhere else?



Further I also want to know what is the recommended place to install mongodb?I am new to Ubuntu so want to go with the recommended/safe practices suggested by experienced developers.Thankyou!










share|improve this question

























  • the recommended way for mongodb is sudo apt-get install mongodb

    – pim
    Apr 18 '18 at 14:19













  • For Node.js, you can use their repository. See this: linuxuprising.com/2018/04/… it explains installing from their repository as well as setting the PATH correctly.

    – Logix
    Apr 18 '18 at 19:18











  • I'd definitely recommend installing via supported packages rather than copying files into /usr/local manually. For MongoDB: docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu. For Node: github.com/nodesource/distributions#debinstall.

    – Stennie
    Apr 19 '18 at 7:00











  • @Stennie I know it would be easy to install through packages but as I have already installed it by copying it to /usr/local directory so want to resolve this permission issue .I first thought as through sudo it will be done but it didn't work with sudo so can you please suggest me how to resolve this permission issue , I tried following command and it didn't work : sudo npm i -g node-static which responded as sudo: npm: command not found

    – user716691
    May 6 '18 at 10:08
















0












0








0


0






I was trying to install node js in my Ubuntu 16.04 LTS , First I have downloaded latest distribution from Nodejs_Official_Page_Link .It got downloaded at my Downloads folder.then I have copied it from Download folder to /usr/local/ Directory through following command:



sudo cp -r node-v9.11.1-linux-x64 /usr/local/


After that I have checked my /usr/local/ Directory and it showed me a folder name node-v9.11.1-linux-x64



After that I have tried to set the path through following command:



sudo nano /etc/environment


Then I have added :/usr/local/node-v9.11.1-linux-x64/bin in PATH



then I checked it through node --version and it showed me v9.11.1
& for npm --version it is 5.6.0



then I tried to run npm i -g node-static and it said permission error ,try it as root.I know it can be done with sudo then.



So my question is that /usr/local/ a correct choice to install Node-js or should I install it somewhere else?



Further I also want to know what is the recommended place to install mongodb?I am new to Ubuntu so want to go with the recommended/safe practices suggested by experienced developers.Thankyou!










share|improve this question
















I was trying to install node js in my Ubuntu 16.04 LTS , First I have downloaded latest distribution from Nodejs_Official_Page_Link .It got downloaded at my Downloads folder.then I have copied it from Download folder to /usr/local/ Directory through following command:



sudo cp -r node-v9.11.1-linux-x64 /usr/local/


After that I have checked my /usr/local/ Directory and it showed me a folder name node-v9.11.1-linux-x64



After that I have tried to set the path through following command:



sudo nano /etc/environment


Then I have added :/usr/local/node-v9.11.1-linux-x64/bin in PATH



then I checked it through node --version and it showed me v9.11.1
& for npm --version it is 5.6.0



then I tried to run npm i -g node-static and it said permission error ,try it as root.I know it can be done with sudo then.



So my question is that /usr/local/ a correct choice to install Node-js or should I install it somewhere else?



Further I also want to know what is the recommended place to install mongodb?I am new to Ubuntu so want to go with the recommended/safe practices suggested by experienced developers.Thankyou!







16.04 software-installation nodejs mongodb






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 18 '18 at 13:59









Brixton Mavu

31




31










asked Apr 18 '18 at 13:03









user716691user716691

4527




4527













  • the recommended way for mongodb is sudo apt-get install mongodb

    – pim
    Apr 18 '18 at 14:19













  • For Node.js, you can use their repository. See this: linuxuprising.com/2018/04/… it explains installing from their repository as well as setting the PATH correctly.

    – Logix
    Apr 18 '18 at 19:18











  • I'd definitely recommend installing via supported packages rather than copying files into /usr/local manually. For MongoDB: docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu. For Node: github.com/nodesource/distributions#debinstall.

    – Stennie
    Apr 19 '18 at 7:00











  • @Stennie I know it would be easy to install through packages but as I have already installed it by copying it to /usr/local directory so want to resolve this permission issue .I first thought as through sudo it will be done but it didn't work with sudo so can you please suggest me how to resolve this permission issue , I tried following command and it didn't work : sudo npm i -g node-static which responded as sudo: npm: command not found

    – user716691
    May 6 '18 at 10:08





















  • the recommended way for mongodb is sudo apt-get install mongodb

    – pim
    Apr 18 '18 at 14:19













  • For Node.js, you can use their repository. See this: linuxuprising.com/2018/04/… it explains installing from their repository as well as setting the PATH correctly.

    – Logix
    Apr 18 '18 at 19:18











  • I'd definitely recommend installing via supported packages rather than copying files into /usr/local manually. For MongoDB: docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu. For Node: github.com/nodesource/distributions#debinstall.

    – Stennie
    Apr 19 '18 at 7:00











  • @Stennie I know it would be easy to install through packages but as I have already installed it by copying it to /usr/local directory so want to resolve this permission issue .I first thought as through sudo it will be done but it didn't work with sudo so can you please suggest me how to resolve this permission issue , I tried following command and it didn't work : sudo npm i -g node-static which responded as sudo: npm: command not found

    – user716691
    May 6 '18 at 10:08



















the recommended way for mongodb is sudo apt-get install mongodb

– pim
Apr 18 '18 at 14:19







the recommended way for mongodb is sudo apt-get install mongodb

– pim
Apr 18 '18 at 14:19















For Node.js, you can use their repository. See this: linuxuprising.com/2018/04/… it explains installing from their repository as well as setting the PATH correctly.

– Logix
Apr 18 '18 at 19:18





For Node.js, you can use their repository. See this: linuxuprising.com/2018/04/… it explains installing from their repository as well as setting the PATH correctly.

– Logix
Apr 18 '18 at 19:18













I'd definitely recommend installing via supported packages rather than copying files into /usr/local manually. For MongoDB: docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu. For Node: github.com/nodesource/distributions#debinstall.

– Stennie
Apr 19 '18 at 7:00





I'd definitely recommend installing via supported packages rather than copying files into /usr/local manually. For MongoDB: docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu. For Node: github.com/nodesource/distributions#debinstall.

– Stennie
Apr 19 '18 at 7:00













@Stennie I know it would be easy to install through packages but as I have already installed it by copying it to /usr/local directory so want to resolve this permission issue .I first thought as through sudo it will be done but it didn't work with sudo so can you please suggest me how to resolve this permission issue , I tried following command and it didn't work : sudo npm i -g node-static which responded as sudo: npm: command not found

– user716691
May 6 '18 at 10:08







@Stennie I know it would be easy to install through packages but as I have already installed it by copying it to /usr/local directory so want to resolve this permission issue .I first thought as through sudo it will be done but it didn't work with sudo so can you please suggest me how to resolve this permission issue , I tried following command and it didn't work : sudo npm i -g node-static which responded as sudo: npm: command not found

– user716691
May 6 '18 at 10:08












2 Answers
2






active

oldest

votes


















2














I'm also new on Ubuntu and I installed node few weeks ago.




is that /usr/local a correct choice to install Node-js or should I
install it somewhere else ?




I think that /usr/bin/ is not a bad place to install nodeJs, however keep in mind that other users on your computer won't have access.




I am new to Ubuntu so want to go with the recommended/safe practices
suggested by experienced developers.




According to the documentation : https://docs.npmjs.com/getting-started/fixing-npm-permissions , you should ensure that you've complete all the "manual steps".



I suggest you to use nodesource github repository for automated installation.






share|improve this answer
























  • I know it would be easy to install through packages but as I have already installed it by copying it to /usr/local directory so want to resolve this permission issue .I first thought as through sudo it will be done but it didn't work with sudo so can you please suggest me how to resolve this permission issue , I tried following command and it didn't work : sudo npm i -g node-static which responded as sudo: npm: command not found

    – user716691
    May 6 '18 at 10:11













  • If you want to run Node with manual installation, you should be able to fix your permission issues if you follow the steps described here : docs.npmjs.com/getting-started/fixing-npm-permissions

    – Florian
    May 14 '18 at 9:08











  • thanks for your reply , Did you install mongodb ,if yes then what is the recommended place for same ?

    – user716691
    Jun 26 '18 at 13:04











  • Not yet, however I'm planning to use MongoDB for my next project. I recommend you to install using repertory. You have a sort of tutorial here : digitalocean.com/community/tutorials/…

    – Florian
    Jun 26 '18 at 14:40



















0














I am installing nodejs and npm 10 using this instructions:



https://github.com/nodesource/distributions/blob/master/README.md#debinstall



and installation runs without any problem !






share|improve this answer



















  • 1





    Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.

    – Kevin Bowen
    Jan 13 at 19:35











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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1026105%2fwhat-is-the-recommended-place-to-install-nodejs-and-mongodb-in-ubuntu-16-04-lts%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









2














I'm also new on Ubuntu and I installed node few weeks ago.




is that /usr/local a correct choice to install Node-js or should I
install it somewhere else ?




I think that /usr/bin/ is not a bad place to install nodeJs, however keep in mind that other users on your computer won't have access.




I am new to Ubuntu so want to go with the recommended/safe practices
suggested by experienced developers.




According to the documentation : https://docs.npmjs.com/getting-started/fixing-npm-permissions , you should ensure that you've complete all the "manual steps".



I suggest you to use nodesource github repository for automated installation.






share|improve this answer
























  • I know it would be easy to install through packages but as I have already installed it by copying it to /usr/local directory so want to resolve this permission issue .I first thought as through sudo it will be done but it didn't work with sudo so can you please suggest me how to resolve this permission issue , I tried following command and it didn't work : sudo npm i -g node-static which responded as sudo: npm: command not found

    – user716691
    May 6 '18 at 10:11













  • If you want to run Node with manual installation, you should be able to fix your permission issues if you follow the steps described here : docs.npmjs.com/getting-started/fixing-npm-permissions

    – Florian
    May 14 '18 at 9:08











  • thanks for your reply , Did you install mongodb ,if yes then what is the recommended place for same ?

    – user716691
    Jun 26 '18 at 13:04











  • Not yet, however I'm planning to use MongoDB for my next project. I recommend you to install using repertory. You have a sort of tutorial here : digitalocean.com/community/tutorials/…

    – Florian
    Jun 26 '18 at 14:40
















2














I'm also new on Ubuntu and I installed node few weeks ago.




is that /usr/local a correct choice to install Node-js or should I
install it somewhere else ?




I think that /usr/bin/ is not a bad place to install nodeJs, however keep in mind that other users on your computer won't have access.




I am new to Ubuntu so want to go with the recommended/safe practices
suggested by experienced developers.




According to the documentation : https://docs.npmjs.com/getting-started/fixing-npm-permissions , you should ensure that you've complete all the "manual steps".



I suggest you to use nodesource github repository for automated installation.






share|improve this answer
























  • I know it would be easy to install through packages but as I have already installed it by copying it to /usr/local directory so want to resolve this permission issue .I first thought as through sudo it will be done but it didn't work with sudo so can you please suggest me how to resolve this permission issue , I tried following command and it didn't work : sudo npm i -g node-static which responded as sudo: npm: command not found

    – user716691
    May 6 '18 at 10:11













  • If you want to run Node with manual installation, you should be able to fix your permission issues if you follow the steps described here : docs.npmjs.com/getting-started/fixing-npm-permissions

    – Florian
    May 14 '18 at 9:08











  • thanks for your reply , Did you install mongodb ,if yes then what is the recommended place for same ?

    – user716691
    Jun 26 '18 at 13:04











  • Not yet, however I'm planning to use MongoDB for my next project. I recommend you to install using repertory. You have a sort of tutorial here : digitalocean.com/community/tutorials/…

    – Florian
    Jun 26 '18 at 14:40














2












2








2







I'm also new on Ubuntu and I installed node few weeks ago.




is that /usr/local a correct choice to install Node-js or should I
install it somewhere else ?




I think that /usr/bin/ is not a bad place to install nodeJs, however keep in mind that other users on your computer won't have access.




I am new to Ubuntu so want to go with the recommended/safe practices
suggested by experienced developers.




According to the documentation : https://docs.npmjs.com/getting-started/fixing-npm-permissions , you should ensure that you've complete all the "manual steps".



I suggest you to use nodesource github repository for automated installation.






share|improve this answer













I'm also new on Ubuntu and I installed node few weeks ago.




is that /usr/local a correct choice to install Node-js or should I
install it somewhere else ?




I think that /usr/bin/ is not a bad place to install nodeJs, however keep in mind that other users on your computer won't have access.




I am new to Ubuntu so want to go with the recommended/safe practices
suggested by experienced developers.




According to the documentation : https://docs.npmjs.com/getting-started/fixing-npm-permissions , you should ensure that you've complete all the "manual steps".



I suggest you to use nodesource github repository for automated installation.







share|improve this answer












share|improve this answer



share|improve this answer










answered Apr 18 '18 at 13:27









FlorianFlorian

1393




1393













  • I know it would be easy to install through packages but as I have already installed it by copying it to /usr/local directory so want to resolve this permission issue .I first thought as through sudo it will be done but it didn't work with sudo so can you please suggest me how to resolve this permission issue , I tried following command and it didn't work : sudo npm i -g node-static which responded as sudo: npm: command not found

    – user716691
    May 6 '18 at 10:11













  • If you want to run Node with manual installation, you should be able to fix your permission issues if you follow the steps described here : docs.npmjs.com/getting-started/fixing-npm-permissions

    – Florian
    May 14 '18 at 9:08











  • thanks for your reply , Did you install mongodb ,if yes then what is the recommended place for same ?

    – user716691
    Jun 26 '18 at 13:04











  • Not yet, however I'm planning to use MongoDB for my next project. I recommend you to install using repertory. You have a sort of tutorial here : digitalocean.com/community/tutorials/…

    – Florian
    Jun 26 '18 at 14:40



















  • I know it would be easy to install through packages but as I have already installed it by copying it to /usr/local directory so want to resolve this permission issue .I first thought as through sudo it will be done but it didn't work with sudo so can you please suggest me how to resolve this permission issue , I tried following command and it didn't work : sudo npm i -g node-static which responded as sudo: npm: command not found

    – user716691
    May 6 '18 at 10:11













  • If you want to run Node with manual installation, you should be able to fix your permission issues if you follow the steps described here : docs.npmjs.com/getting-started/fixing-npm-permissions

    – Florian
    May 14 '18 at 9:08











  • thanks for your reply , Did you install mongodb ,if yes then what is the recommended place for same ?

    – user716691
    Jun 26 '18 at 13:04











  • Not yet, however I'm planning to use MongoDB for my next project. I recommend you to install using repertory. You have a sort of tutorial here : digitalocean.com/community/tutorials/…

    – Florian
    Jun 26 '18 at 14:40

















I know it would be easy to install through packages but as I have already installed it by copying it to /usr/local directory so want to resolve this permission issue .I first thought as through sudo it will be done but it didn't work with sudo so can you please suggest me how to resolve this permission issue , I tried following command and it didn't work : sudo npm i -g node-static which responded as sudo: npm: command not found

– user716691
May 6 '18 at 10:11







I know it would be easy to install through packages but as I have already installed it by copying it to /usr/local directory so want to resolve this permission issue .I first thought as through sudo it will be done but it didn't work with sudo so can you please suggest me how to resolve this permission issue , I tried following command and it didn't work : sudo npm i -g node-static which responded as sudo: npm: command not found

– user716691
May 6 '18 at 10:11















If you want to run Node with manual installation, you should be able to fix your permission issues if you follow the steps described here : docs.npmjs.com/getting-started/fixing-npm-permissions

– Florian
May 14 '18 at 9:08





If you want to run Node with manual installation, you should be able to fix your permission issues if you follow the steps described here : docs.npmjs.com/getting-started/fixing-npm-permissions

– Florian
May 14 '18 at 9:08













thanks for your reply , Did you install mongodb ,if yes then what is the recommended place for same ?

– user716691
Jun 26 '18 at 13:04





thanks for your reply , Did you install mongodb ,if yes then what is the recommended place for same ?

– user716691
Jun 26 '18 at 13:04













Not yet, however I'm planning to use MongoDB for my next project. I recommend you to install using repertory. You have a sort of tutorial here : digitalocean.com/community/tutorials/…

– Florian
Jun 26 '18 at 14:40





Not yet, however I'm planning to use MongoDB for my next project. I recommend you to install using repertory. You have a sort of tutorial here : digitalocean.com/community/tutorials/…

– Florian
Jun 26 '18 at 14:40













0














I am installing nodejs and npm 10 using this instructions:



https://github.com/nodesource/distributions/blob/master/README.md#debinstall



and installation runs without any problem !






share|improve this answer



















  • 1





    Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.

    – Kevin Bowen
    Jan 13 at 19:35
















0














I am installing nodejs and npm 10 using this instructions:



https://github.com/nodesource/distributions/blob/master/README.md#debinstall



and installation runs without any problem !






share|improve this answer



















  • 1





    Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.

    – Kevin Bowen
    Jan 13 at 19:35














0












0








0







I am installing nodejs and npm 10 using this instructions:



https://github.com/nodesource/distributions/blob/master/README.md#debinstall



and installation runs without any problem !






share|improve this answer













I am installing nodejs and npm 10 using this instructions:



https://github.com/nodesource/distributions/blob/master/README.md#debinstall



and installation runs without any problem !







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 13 at 19:19









IbakIbak

1




1








  • 1





    Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.

    – Kevin Bowen
    Jan 13 at 19:35














  • 1





    Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.

    – Kevin Bowen
    Jan 13 at 19:35








1




1





Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.

– Kevin Bowen
Jan 13 at 19:35





Welcome to Ask Ubuntu! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.

– Kevin Bowen
Jan 13 at 19:35


















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1026105%2fwhat-is-the-recommended-place-to-install-nodejs-and-mongodb-in-ubuntu-16-04-lts%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

Human spaceflight

Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

張江高科駅