Npm tips and tricks
Jump to navigation
Jump to search
$npm install vs $ npm ci [1]
the difference between npm install
and npm ci
, it is worth explaining it. npm install
will generate a new package-lock.json
if it does not exist or it will update the dependency tree if it does not match the packages specified in the package.json
. npm ci
will install packages based on package-lock.json
file and if the file does not exist or does not match the packages specified in the package.json
it will throw an error and fail.
Note it is better to use npm ci
if you are not going to add new packages or update the package version to keep the development consistent with other team members.