Module 41: Node.js Fundamentals

Lesson 2 of 5 · 15–25 minutes

npm and package.json in depth

🏠The everyday picture

A recipe that lists exact brands and pack sizes, so anyone who follows it gets the same dish, not "some flour".

📘What it really is

🖱️Try it

In enquiries-api, install express and, as development tools, typescript, @types/express and @types/node. Open package.json and package-lock.json and find Express in each. Run npm audit and npm outdated. Commit, making sure node_modules is in .gitignore and the lock file is included.

✅Quick check

Should package-lock.json be committed?

Show the answer

Yes. It ensures everyone installs exactly the same versions.

An AI suggests installing a package you've never heard of with 40 downloads a week. What do you check?

Show the answer

Whether it's needed at all, whether it's maintained and trusted, and that the name isn't a look-alike of a popular package.

← PreviousThe Node.js runtime
ProLearners Assist