Installation
Using the correct Node version #
Open up the command line and go in to the theme:
cd themes/custom/compony
Next, run this command:
nvm use
This will instruct the terminal to use the version of Node found in the .nvmrc file
.If the command line complains that this version is not available, you have to install that version of Node first. The command line will instruct you how to install this version of Node that is missing. After you follow those instructions, you have to run the following command again:
nvm use
Some more information: if all goes well, you will have a few versions of node installed on your system, nvm makes sure that you can have multiple, and that your command line can easily switch between them. Remember that if you close the command line, and open it up again, your command line will be using the default Node version again. So each time you start developing, it's wise to run nvm use
, so you are sure you are using the correct version of Node before you run a Gulp-command.
Installing Node modules #
Make sure you are using the right version of Node as defined in the .nvmrc file
before you start. You can install the node-packages with npm or with Yarn.
npm install
or
yarn install
Both commands have the same result, and you will have a node_modules
folder next to where the package.json
is located.
That’s it! You can now run Gulp commands!