These other packages are known as dependencies. Well, this is because npm packages tend to rely on other npm packages in order to run their specific function. If you’ve ever had a project with a node_modules folder and dared to see what it contained, you probably saw that it had lots (and I mean LOTS) of nested folders and files. One thing to note: when you install an npm package, npm creates a folder called node_modules and stores all the package files there. Seems pretty straightforward, right? The node_modules folder So for Macs if would look like: sudo npm install Here’s the basic syntax to install a package:ĭepending on your setup, you may need to add the “sudo” keyword at the beginning to run this with root permissions. This is great, because you don’t have to manually go to the website, download and execute the file to install. The beauty of npm is that it allows you to install packages directly on your command line. You’ll also need a few more, which we’ll get into later. Npm is a continually updated collection of JavaScript plugins (called packages), written by developers around the world. What’s npm, you ask? Npm (Node Package Manager) When you install Node, it also installs npm onto your computer. You can download it from the Node.js website. Gulp runs using Node, so you understandably need to install Node before getting started. Node.js is self-described as a “JavaScript runtime”, which is considered the back-end of JavaScript. In order to get Gulp up and running on your computer, you need to install Node.js onto your local environment. Now let’s get started! Set up your environment Node.js I’ll explain everything one step at a time. Let your computer do your work for you!ĭon’t worry if you don’t totally understand all the terms above.Configure your gulpfile.js file to run the tasks you want.Install Gulp and other packages needed for your project.Install Node.js and npm to your computer.Here are the steps this tutorial will be going through: However, this tutorial will be focused on just the basics of Gulp and how it works. Gulp can do a lot more complex tasks than the ones I’ve mentioned above. And automatically running the above tasks when a file change is detected.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |