Installing Nodejs
- Build a dependent environment
First install the g++ compiler and Git, enter the following command in the terminal
sudo apt-get install g++ Curl Libssl-dev apache2-utils
sudo apt-get install Git-core
git does not need to be installed if it is already installed .
2. Install node. js
Direct Input Command sudo apt-get install Nodejs installed is version 0.6, this will cause problems, resulting in the next installation of JS test tool karma, there is a problem.
So download and install the way to the official website to download http://nodejs.org
Click Install directly to download the standard version of node-v0.10.29
Then, execute the Install command command
CD node-v0.10.29
ls View within the node-v0.10.29 folder whether there is a configure this file, if not, it may not be the Standard Edition
sudo./configure errors may occur if you do not add sudo
sudo make This step may take a while
sudo make install
Test whether the installation was successful
Node--version
If v0.10.29 is the version number, the installation succeeds
Installing NPM
sudo apt-get install NPM
Installing Karma
sudo npm install-g karma wait patiently
As long as the installation of Nodejs is correct, then the next two steps will be very smooth, otherwise there will be error when installing Karma
Note: Be sure to add sudo before the command, otherwise there is no permission, prone to errors