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
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
npm --version it is
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
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!
sudo apt-get install mongodb
/usr/localmanually. For MongoDB: docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu. For Node: github.com/nodesource/distributions#debinstall.
/usr/localdirectory so want to resolve this permission issue .I first thought as through
sudoit will be done but it didn't work with
sudoso 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-staticwhich responded as
sudo: npm: command not found