Node JS Package Manager - NPM

Search for a command to run...

No comments yet. Be the first to comment.
In this tutorial series, we will understand the Fundamentals of NodeJs and learn to use Javascript on the server side.
What is a Module in Node.js? In NodeJS, every JS file is a module. Consider modules to be the same as JavaScript libraries. A set of functions, variables, you want to include in other JS files (modules) of your application. Built-in Modules Node.js h...
You've done it. I've done it. We've all done it.

Your AI Agent Has Amnesia. ByteRover Fixes It — Without Vectors Let's see how to built a customer support agent that remembers everything — using plain markdown files, BM25 search, zero embeddings, a

My GenAI cohort kicked off today, and what a first day! Right away we were reminded that AI isn’t magic — at its core, models like Generative Pretrained Transformers (GPT) are doing one simple thing:

Hello Folks👋, I Recently got Graduated🎓 in 2020, yep in the Pandemic. We all hit very hard by this Corona Pandemic and we all got stuck at home for very long. We all realize the Importance of Socializing, Fitness (Physically as well Mentally), Diet...

So after learning the basic commands of git in our previous section, let's see Git in action. If you already have a project to track your files then you can skip this section and if not then continue. Initializing a Repository from Non-existing Dire...

Node Package Manager (NPM) provides two main functionalities -
NPM comes bundled with Node.js installables after v0.6.3 version. To verify the same, open console and type the following command and see the result -
npm --version
// syntax
npm install <Module Name>
For example, following is the command to install a famous Node.js web framework module called express -
npm install express
By default, NPM installs any dependency in the local mode. Here local mode refers to the package installation in node_modules directory lying in the folder where Node application is present. Locally deployed packages are accessible via require() method.
Now let's try installing the express module using local installation.
npm install express
Globally installed packages/dependencies are stored in system directory. Such dependencies can be used in CLI (Command Line Interface) function of any node.js but cannot be imported using require() in Node application directly. Now let's try installing the express module using global installation.
npm install express -g
package.json is present in the root directory of any Node application/module and is used to define the information of the current project and it contains list of dependencies present in your project.
As node_modules/ folder contains packages and is not a part of code base so we don't share this folder along with the source code but this folder can be regenerate using package.json by using below command in the root directory of the project
npm install
OR
npm i
In this section, we saw the learn about Node JS package manager and its Usage