Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command to use restoring npm packages

When I download a project from my repo with a package.json in its root, which command is the right one to use npm install or npm install restore?

like image 683
Sam Avatar asked Dec 09 '17 16:12

Sam


People also ask

Does npm do a clean install?

The npm clean-install command (or npm ci for short) is an in-place replacement for npm install with two major differences: It does a clean install: if the node_modules folder exists, npm deletes it and installs a fresh one. It checks for consistency: if package-lock.


2 Answers

The behaviour of npm install is

  • npm install without any argument will install all packages found in package.json in node_modules folder.

  • npm install <package_name> will install package_name. In your case will download restore package and will save it in node_modules folder. (https://www.npmjs.com/package/restore)

like image 121
banuj Avatar answered Oct 12 '22 22:10

banuj


Just type:

npm i 

From help:

>npm i -h  npm install (with no args, in package dir) npm install [<@scope>/]<pkg> npm install [<@scope>/]<pkg>@<tag> npm install [<@scope>/]<pkg>@<version> npm install [<@scope>/]<pkg>@<version range> npm install <folder> npm install <tarball file> npm install <tarball url> npm install <git:// url> npm install <github username>/<github project>  aliases: i, isntall, add common options: [--save-prod|--save-dev|--save-optional] [--save-exact] [--no-save] 
like image 31
John Deer Avatar answered Oct 13 '22 00:10

John Deer