Install node. js and ubuntu14.04node. js in ubuntu14.04
After checking on the Internet, a node-v0.12.7-linux-x64.tar.gz file is first downloaded, decompress it in the/home/node path, and add the following command to/etc/profile:
Export NODE_HOME =/home/node/node-v0.12.7-linux-x64
Export PATH = $ PATH: $ NODE_HOME/bin
Export NODE_PATH = $ NODE_HOME/lib/node_modules
Configure the environment variables and then execute
Source/etc/profile
Make the profile take effect immediately, and then run the node-v command to check whether the node version works. The above three lines of code directly executed on the terminal did not work, and later I found the following method:
The Node. js version that comes with Ubuntu 14.04 is too old. You need to add Node. js PPA to install the latest Node. js version. Run the following command on the terminal:
Sudo add-apt-repository ppa: chris-lea/node. jssudo apt-get updatesudo apt-get install nodejs
After the installation is complete, run the node-v command and find that the installation is successful.