AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Npm i11/20/2023 That’s not part of Sass… right? Well, that’s correct, but there’s a very good explanation why those new items were generated in the project folder. What are these!? We asked npm to install Sass, not all this stuff. Oddly, however, we do see a three new items in the project folder: two JSON files named package.json and package-lock.json, plus one entirely new node_modules folder. Once we’ve run the install command, you may notice that you do not see anything named “sass” in the project folder as you might expect. (This is why you see that npm added 16 packages and audited a total of 17 npm packages, instead of the Sass package alone-it, too, has dependencies!) If it finds that package (which it does), npm installs it to the project in an automatically generated node_modules folder (more on this in a bit) located in the project root folder, including everything the package needs to run. What’s happening behind the scenes there is that npm tries to find a package named sass in the npm package registry. That’s all you need! Type that and npm goes straight to work: For example, the Node package for Sass is simply called “sass” which means we can add to a project like this (just be sure you’re in a new folder you created for this little project first): npm install sass We can install our very first package with the npm install command (or npm i for short), followed by the name of the packages we want to add to our project.
0 Comments
Read More
Leave a Reply. |