Skip to content

Try our new Crash Courses!

Buy one of our new Crash Courses, now hosted on Teachable.

Using npm with Git

Summary

Add the following entry to your .gitignore file:

node_modules/

Details

When using npm, you don’t want to commit your node_modules folder to your repo, so you should add it to your .gitignore file.

You should commit your package.json and package-lock.json files. This will allow other developers who clone your project to download your project’s dependencies using the npm install command.

Exercises

There are no exercises for this lesson.

Back to: npm Reference > npm Extra