Installing and building an existing project with npm and grunt on CentOS 7

This is the basic process to install and build an existing GRUNT project with npm on CentoOS 7.

  1. Install npm via CentOS EPEL

    npm is the package manager for JavaScript

     yum install epel-release npm
  2. Set your npm prefix to somewhere you have write access to bin, etc, & lib. The bin directory should be in your $PATH, i.e.

    It is not recommended to run npm as root.

     npm config set prefix '~/'
     export PATH=~/bin:$PATH
  3. Install GRUNT

    GRUNT is the JavaScript Task Runner

     npm install -g grunt-cli
  4. Install project_dir

    A typical GRUNT project has a package.json and a Gruntfile.js in a project_dir, i.e.

     cd project_dir
     npm install