If you've previously installed gulp globally, run npm rm --global gulp
before following these instructions. For more information, read this Sip.
node --version
npm --version
npx --version
If they are not installed, follow the instructions here.
npm install --global gulp-cli
npx mkdirp my-project
cd my-project
npm init
This will guide you through giving your project a name, version, description, etc.
npm install --save-dev gulp
gulp --version
Ensure the output matches the screenshot below or you might need to restart the steps in this guide.
Using your text editor, create a file named gulpfile.js in your project root with these contents:
function defaultTask(cb) {
// place code for your default task here
cb();
}
exports.default = defaultTask
Run the gulp command in your project directory:
gulp
To run multiple tasks, you can use gulp <task> <othertask>
.