Overview
Grunt and grunt plug-ins should be defined as project dependencies in the Package.json of your project. This allows you to use a separate command: NPM install installs all the dependencies in your project (the grunt and grunt Plug-ins defined in Package.json will automatically install dependencies when using NPM install, as we have learned, These dependencies are defined in the Package.json. The currently stable and developed grunt versions are always listed on the wiki page.
Install Nodejs
Through the previous relevant introduction of grunt translation, we all know that grunt operation can not be separated from Nodejs and NPM. So to use grunt first, your system needs to install Nodejs and NPM.
Next, take a quick look at the installation of Nodejs.
Install Nodejs under Mac
If you use the Homebrew Task Manager, you can install Nodejs directly at the terminal by executing the following command:
The code is as follows |
Copy Code |
$ Brew Install node |
Or install Nodejs using the following steps:
• Install Xcode
• Install git
• Run the following command at the terminal
The code is as follows |
Copy Code |
git clone git://github.com/ry/node.git CD node ./configure Make sudo make install |
Install Nodejs under Ubuntu
First you have to install some dependencies:
The code is as follows |
Copy Code |
sudo apt-get install g++ libssl-dev apache2-utils sudo apt-get install Git-core
|
Next, execute at the command terminal:
The code is as follows |
Copy Code |
git clone git://github.com/ry/node.git CD node ./configure Make sudo make install |
Install Nodejs under Windows
To install Nodejs under Windows, you need to use Cygwin. and follow the steps below to install it:
Install Cygwin, and then use Setup.exe to install the following package in the Cygwin project:
The code is as follows |
Copy Code |
Devel→openssl DEVEL→G++-GCC Devel→make Python→python Devel→git |
Open the Cygwin command line by Start→cygwin→cygwin Bash Shell and perform the following command to install the Nodejs:
code is as follows |
copy code |
git clone Git://github.com/ry/node.git CD node ./configure Make sudo make install |