Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference betweene 'npm i' and 'npm install'?

Tags:

javascript

npm

What is the difference between npm i and npm install commands? Both install all node Modules from package.json.

I know that it means to install. It could be possible that there is some difference between i and install.

like image 210
otto Avatar asked Mar 29 '18 19:03

otto


People also ask

What is the difference between npm install and npm I?

npm i: The npm i (or npm install) is used to install all dependencies or devDependencies from a package. json file. npm ci: CI stands for clean install and npm ci is used to install all exact version dependencies or devDependencies from a package-lock.

What does npm I stand for?

Introduction to npm Npm stands for Node Package Manager. It is a package manager for the Node JavaScript platform.

What does npm install mean?

The npm install installs all modules that are listed on package. json file and their dependencies. npm update updates all packages in the node_modules directory and their dependencies.

Is npm init the same as npm install?

npm init is a convenient way of scaffolding your package. json; you may need to run it everytime you are starting a new project. npm install , however, installs your dependencies in node_modules folder. You may need to run this everytime you manually add a dependency to your package.


2 Answers

There is no difference, since "npm i" is an alias for "npm install". They both do the exact same thing (install or update all the dependencies in your package-lock.json).

Docs: https://docs.npmjs.com/cli/install via CRice

like image 114
TrystanHumann Avatar answered Oct 01 '22 03:10

TrystanHumann


npm install (aliases: npm i, npm add ) (with no args, in package dir)
         npm install [<@scope>/]<name>
         npm install [<@scope>/]<name>@<tag>
         npm install [<@scope>/]<name>@<version>
         npm install [<@scope>/]<name>@<version range>
         npm install <git-host>:<git-user>/<repo-name>
         npm install <git repo url>
         npm install <tarball file>
         npm install <tarball url>
         npm install <folder>
like image 34
Mariselvam Avatar answered Oct 01 '22 02:10

Mariselvam