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
?
Asked
Active
Viewed 6.1k times
50

Sam
- 26,817
- 58
- 206
- 383
2 Answers
87
The behaviour of npm install
is
npm install
without any argument will install all packages found inpackage.json
innode_modules
folder.npm install <package_name>
will installpackage_name
. In your case will downloadrestore
package and will save it innode_modules
folder. (https://www.npmjs.com/package/restore)

banuj
- 3,080
- 28
- 34
-
1Looks like restore has nothing to do with restoring packages. That package seems to be about remote storage. Thank you! – Sam Dec 09 '17 at 16:21
9
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]

John Deer
- 2,033
- 2
- 13
- 16