Need install nodejs-legacy package, it's a symlink bug fix: sudo apt-get install nodejs-legacy. Then install npm: sudo apt-get install npm. And right way to install Node.js:
Usually the installed nodejs by apt-get is very old, we may need to update it to newer version.
n is the node version management tool which can run on any platform. But on my virtual ubuntu it doesn't work. It throws a error invalid version.
Finally, I find another way to install the latest nodejs.
Step 1: Add NodeJs PPA
First, you need to node.js PPA in our system provides by nodejs official website. We also need to install python-software-properties package if not installed already.
After adding required PPA file lets install Node package. NPM will also be installed with node.js. This command will also install many other dependent packages on your system.
$ sudo apt-get install nodejs
Step 3: Check Node.js and NPM Version
After installing node.js verify and check the installed version. You can find more details about current version on node.js official website.
apt-get
apt-get is the package management tool for ubuntu
Proxy
Edit /etc/apt/apt.conf
With user name
ps.there is another way to config proxy, not works at my os. How to run “sudo apt-get update” through proxy in commandline?
References:
Update apt cache
Update local packages indexes. This is required before install/update packages.
Install nodejs/npm
Problems
Need install nodejs-legacy package, it's a symlink bug fix: sudo apt-get install nodejs-legacy. Then install npm: sudo apt-get install npm. And right way to install Node.js:
install-node-js-in-ubuntu-14-04
Usually the installed nodejs by apt-get is very old, we may need to update it to newer version. n is the node version management tool which can run on any platform. But on my virtual ubuntu it doesn't work. It throws a error invalid version.
Finally, I find another way to install the latest nodejs.
Step 1: Add NodeJs PPA
First, you need to node.js PPA in our system provides by nodejs official website. We also need to install python-software-properties package if not installed already.
Step 2: Install Node.js and NPM
After adding required PPA file lets install Node package. NPM will also be installed with node.js. This command will also install many other dependent packages on your system.
Step 3: Check Node.js and NPM Version
After installing node.js verify and check the installed version. You can find more details about current version on node.js official website.
Idea from How to Install Latest Nodejs & Npm on Ubuntu 16.04 & 14.04
Install mongodb
After installed, you can create db in mongodb command line
Share folder
mount share folder
References