When you install nodejs you will get npm along with it
To check node and npm version
node -v npm -v
- It is an online repository for the publishing of open-source Node.js projects
if you want to import the testing framework you can just install it by
npm install --save-dev jest
- It is a command-line utility for package installation, version management, and dependency management.
if you have module
@jest/core, you can update to the latest version by
npm install @jest/core@latest
Once you install the library, it will store in
node_modules gonna be a big folder, so you do not push it into git.
It is recommended to have
package-lock.json, to help you know those libraries and their versions
To create a package.json file
Package.json - list the version of its dependencies (library we install), and also other project information such as name, version, author, script, etc.
Package-lock.json - list solely about the dependencies in depth
Now when you want to install those libraries, npm can get the info from
To install dependencies just run:
- You can have only
- But you can not have only
package-lock.json have to come with
** And both files need to be stored in git