In this lesson, we learn how to get up and running with Gulp by initializing our project with
npm init and then installing the Gulp CLI globally and then installing it locally to our project. We finish the lesson off by creating our first Gulp file and running our first Gulp task.
If you're having to use sudo to install with npm, you just have a permission issue, which is very easy to fix.
I've seen a few devs have that issue when they install node with homebrew. If this applies to you, the following has worked for me and other devs before:
sudo chown -R
I use nvm (Node Version Manager) to install and maintain multiple version of node and npm. The bi-product of this process is that it installs the node version and all it's globals in my home directory under ~/.nvm/versions. No permissions issues, and I have a layer of administrative controls over the versions of node and npm I use, including the ability to easily update and move between versions.
Wouldn't recommend this, nvm can be used to avoid this hammer approach.
Great introduction, small note. Current best practice is to install
gulp-cli globally, instead of
gulp itself. All other steps remain the same. More information over at the official docs.