NA +91-8727899942 thecoderjob@gmail.com

CHAPTER - 14

Some basic concept of NPM in node js

Installing packages in Node.js is straightforward using npm (Node Package Manager) or yarn. Here's how you can do it:

- Install project ( npm init -y )

Install a package ( npm install  )

- Install a package as a development dependency ( npm install --save-dev )

- Install a package globally ( npm install -g )

- To save the package as a dependency ( npm install --save )

- To update all packages ( npm update )

 

Here's is the Code !!

{
  "name": "my-node-app",
  "version": "1.0.0",
  "description": "A sample Node.js application",
  "main": "index.js",
  "scripts": {
    "start": "node index.js",
    "test": "echo "Error: no test specified" && exit 1"
  },
  "dependencies": {
    "express": "^4.17.1",
    "mongoose": "^5.13.2"
  },
  "devDependencies": {
    "nodemon": "^2.0.12",
    "jest": "^27.0.6"
  }
}

Chapter 13

What is the concept of Async/Await in node Js

Previous chapter

Chapter 15

How to Setting up Express Js in Node Js

Next chapter

Get In Touch

NA

thecoderjob@gmail.com

+91-8727899942

Popular Links

© www.thecoderjob.com. All Rights Reserved.               Designed by HTML Codex