Initialize with package.json
Open a new command prompt window and navigate to the ClientApp folder.
The package.json file is used in Nodejs projects to store general information about the project (like its name, version, etc) and track what dependencies the project needs (so that anyone can install them all at once).
To create a “default” package.json file, type the “npm init” command with the y option:
npm init -y
The “-y” option uses default options.
Once the npm init
command is done, you should have a package.json
file under your project directory (and nothing else, yet).
The package.json
file can now be used to "document" any dependencies you add to your project. This happens automatically when you npm install
anything.
If the command was successful, it should have created a package.json file with contents similar to this:
{ "name": "demo", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "", "license": "ISC" }
Comments