Join Alexander Zanfir for an in-depth discussion in this video What is the package.json file?, part of Learning Node.js.
- We have our project with our own custom files…and third party packages.…But what if we wanted to distribute our app or project…or put it into a Git repository?…It wouldn't make sense to include…all the packages we depend on.…Because they take up a lot of space.…But then the developer, who just got our project,…will have to manually install all those packages.…To solve that we can specify a package.json file.…Among other things,…it stores a list of the package dependencies…you have in your project.…That way using the npm command install…it will go through that list and install everything.…
Let's take a look at a sample package.json file…and then we'll move on to creating our own.…As you can see on line six…we have the dependencies property which we mentioned before.…That has gulp as as a dependency.…We will cover the rest of these properties…when we create our own package.json file.…Let's do that now.…Let's go back to our console or terminal.…And we'll use the command npm init.…Which will ask us several questions.…
- Installing Node.js
- Writing modules and packages
- Reading and writing files
- Working with frameworks: Express, Sails, and Koa
- Generating promises
- Working with generator functions
Skill Level Beginner
Q: When I try to install Bluebird/Express/Gulp/Sails/KOA using the Node Package Manager, it seems to install correctly in the terminal. But why doesn't my project folder change?
A: You need to make sure that you've navigated to your project folder in the terminal. For example, in this course Alexander is working from the C:\Dev\ folder both in Brackets and in the terminal.