Initializing our server project
In this section, we'll learn how to initialize our server project and install Express.js, which will help us quickly spin up a server without dealing with the low-level APIs provided by the Node.js platform.
npm provides a command that allows developers to create a project (an empty folder with a package.json
file). Let's learn how to use it to generate a package.json
file.
Generating a package.json file
We'll get started by creating a folder for our server files inside the ngsocial/packages/
folder:
- Open a new command-line interface and run the following commands:
cd packages mkdir server && cd server
- Next, run the following command:
npm init --yes
The --yes
flag tells npm to generate a package.json
file with the default settings.
- You can run the following command to update your npm version:
npm install -g npm
We are executing this command because we need to update to npm 7 (if you are not...