check what we are using for this project. say why we use them.
When learning about web development you’ll eventually come across “NPM package”.
Let’s talk a little bit about why you a package is needed in the first place.
A package specifies the dependencies in your project. It is a file or directory described by package.json and published to the NPM registry.
Packages can be installed:
npm install
npm install -g
NPX
(Node Package Executor) runs packages locally to a PC even when it has not yet been installed. It temporarily downloads all packages with no need for installing them locally or globally on your computer. It explicitly executes node packages execute from the NPM registry without local or global installation of the packages as dependencies. It is employed to test run commands or one-time operations. It is bundled with NPM version 5.2.0 and above.
If the packages aren’t already installed, NPX automatically executes them without worrying about installation and the Node.js version.
To execute packages, you don't need to have them in package.json. You only need the command:
npx
npx create-react-app
, for example, can be used to bootstrap a react app.
NPM
(Node Package Manager) is a package management tool, used to install node.js packages only if configured in the package.json
file. It downloads and configures packages locally or globally as dependencies. This Package manager comes pre-installed with Node.js.
The packages must be specified in package.json
for NPM to install them locally.
Here's what listed packages in the package.json look like for a React project:
"dependencies": {
"@testing-library/jest-dom": "^5.16.2",
"@testing-library/react": "^12.1.3",
"@testing-library/user-event": "^13.5.0",
"firebase": "^9.6.11",
"framer-motion": "^6.3.16",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "5.0.0",
"web-vitals": "^2.1.4"
}
To download these packages, you should run the command:
npm install