xxxxxxxxxx
"npm ci" command, which will install the exact versions listed in package-lock. json "npm i" command install the version-ranges given in package
xxxxxxxxxx
Have you deleted package-lock.json file? don't worry
Run below command to generate package-lock.json file in your folder.
npm i --package-lock-only
xxxxxxxxxx
The package-lock.json is solely used to lock dependencies to a
specific version number. So that when teammates clone your work
their dependency versions are the same as yours, or vice versa.
xxxxxxxxxx
cases | npm install | npm ci
--------------------------------------|-------------|-------------
needs package.json | no | yes
needs package-lock.json | no | yes
installs from package.json | yes | no
installs from package-lock.json | no | yes
compares both | no | yes
updates loose package versions | yes | no
updates loose dependencies | yes | no
writes to package.json | yes | no
writes to package-lock.json | yes | no
deletes node_modules before install | no | yes
used for installing separate package | yes | no
should be used on build systems / CI | no | yes
can be used for development | yes | yes
reproducible installs | no | yes
package-lock.json is automatically generated for any operations where npm modifies either the node_modules tree, or package.json. It describes the exact tree that was generated, such that subsequent installs are able to generate identical trees, regardless of intermediate dependency updates.