npm and node (Optional)
Explore how to bootstrap a React app by using npm to install and manage Node packages. Learn the difference between global and local package installations, how to initialize a project with package.json, and how to handle dependencies and dev dependencies efficiently.
We'll cover the following...
The node package manager (npm) installs external node packages from the command line. These packages can be a set of utility functions, libraries, or whole frameworks, and they are the dependencies of your application. You can either install these packages to your global node package folder, or to your local project folder.
Global node packages are accessible from everywhere in the terminal, and only need to be installed to the global directory once. Install a global package by typing the following into a terminal:
The -g flag tells npm to install the package globally. Local packages are used in your application by default. For our purposes, we will install React to the local directory terminal by typing: