What was the Stone Age project like? Create a new folder and fill it with js, HTML, CSS, etc code files. If the project is handed over with no documentation and no information about the project, then you know the pain of reading the code and sorting out dependencies. In modern times, after the birth of NPM, developers realized that a project was doing this rather hastily. Shouldn’t there be a document to document this? So package.json was accepted.
Installation environment
- Since I am using Windows, I just need to download the latest Node installation package MSI from the official website and install it. Node official Download
Once you’ve installed your environment, create a new project folder in your project workspace. I’ll call it ailys-react-admin.
Open CMD and run the NPM init command, which asks you to enter some information about the project. Press Enter to use the recommended configuration, and enter y to confirm:
Name: project name version: initial version description: project description Entry Point Test Command: default startup command git Repository: Git address (if there is a repository, I do not enter git address) Keywords: project keywords: author: license: used for project publishing
You’ll see a package.json file in your current directory that contains the information you just set.
To add the index.js file to your project, try writing some code
Finally, in the project directory, run CMD: node index.js to see the code executed:
The next section introduces the configuration of package.json:…