morteza
morteza

Reputation: 738

package.Json different packages version in the team

We are facing different packages version among team members depend on when they run npm i or yarn. I know the root of the problem is ^ in the version of the package json package list.

Is it goog idea to use the exact version and ignore the minor updates? Is there a better approach?

thank.

Upvotes: 0

Views: 670

Answers (1)

PR7
PR7

Reputation: 1904

You need to use package-lock.json file to keep track of the exact version of every package that is installed so that a product is 100% reproducible in the same way even if packages are updated.

package-lock.json is automatically generated for any operations where npm modifies either the node_modules tree, or package.json. You need to commit this file in the repostitory after installing/updating a package.

Here are some usefull links to get you started:

Link1

Link2

Upvotes: 1

Related Questions