Creation for nodejs Commands for easy reference.
Step 1) Go to the site https://nodejs.org/en/download/ and download the necessary binary files. In our example, we are going to download the 64-bit setup files for Node.js.
Step 2) Double click on the downloaded .msi file(for WindowsOs) or .pkg file (For MacOs)to start the installation. Click the Run button to begin the installation.
Step 3) Click the “Next” button to continue with the installation.
Step 4) Accept the license agreement and click on the Next button.
Step 5) Choose the location where Node.js needs to be installed and then click on the Next button.
1. First, enter the file location for the installation of Node.js. This is where the files for Node.js will be stored after the installation.
2. Click on the Next button to proceed ahead with the installation.
Step 6) Accept the default components and click on the Next button.
Step 7) Click the Install button to start the installation.
Step 8) Click the Finish button to complete the installation.
Step 9) “npm install -g express-generator” command (for WindowsOs) or “sudo npm install -g express-generator” (For MacOs) give initial time.
Step 10) “npm init” command to create a package.json is present in the root directory of any Node application/module and is used to define the properties of a package. Step 11) “express - -view=ejs”. (Embedded JavaScript)(for WindowsOs) or express(For MacOs) command to create project structure.
Project Structure will be created as per the below format:
public
public\ javascripts
public\ images
public\ stylesheets
public\ stylesheets\ style.css
routes
routes\ index.js
routes\ users.js
views
views\ error.ejs
views\ index.ejs
app.js
package.json
bin
bin\ www
Step 12) “npm install” command to create node modules (packages).
Step 13) “npm start” command to create Execution the process.
Copyright 2020, Trident Solutions
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
