The first step is to install Node.js if it is not already installed on the development computer.
With a Debian-based operative system such as Ubuntu, installing Node.js could be as simple as using the apt
package manager. From the command line, use the following command:
$ sudo apt-get install -y nodejs
Please refer to the installation instructions for the correct operating system from the Node.js website (https://nodejs.org).
The next step involves installing gulp, which Elixir will use to run its tasks. For this step, the Node.js package manager (npm) is required. If npm
is not already installed, then the apt
package installer is to be use. The following command will be used to install npm
:
$ sudo apt-get install npm
The npm uses a json
file to manage the project's dependencies: package.json
. This file is found in the root of the Laravel project directory and has the following format:
{ "devDependencies": { "gulp": "^3.8.8", "laravel-elixir": "*" } }
Gulp and Laravel Elixir are installed as dependencies.