npm-vs-yarn | Compare npm vs yarn | Build Tool library
kandi X-RAY | npm-vs-yarn Summary
kandi X-RAY | npm-vs-yarn Summary
Compare npm vs yarn
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of npm-vs-yarn
npm-vs-yarn Key Features
npm-vs-yarn Examples and Code Snippets
Community Discussions
Trending Discussions on npm-vs-yarn
QUESTION
I'm new to yarn and something caught my eyes while reading this article which states :
Deterministic:
The same dependencies will be installed the same exact way across every machine regardless of install order. Yarn resolves "works on my machine" issues around versioning and non-determinism by using lockfiles and an install algorithm that is deterministic and reliable
Question:
I don't understand : When I write npm install
it looks at the package.json
and installs the exact version and each version also installed its dependencies according to its own package.json
and so on and so on
So what's the difference (regarding this aspect)
An example of scenario for "thing that can go wrong in npm while not in yarn" will be much appreciated
...ANSWER
Answered 2018-Jan-01 at 13:51The package.json file often contains the minimum version required of a dependency. For instance, you could have "^1.0.0", which matches with version 1.0.0 or any minor releases.
{
"name": "my_package",
"version": "1.0.0",
"dependencies": {
"my_dep": "^1.0.0"
}
}
When you run npm install, it could install the version 1.0.0, 1.1.0, 1.2.0 etc of "my_dep", because all those versions meet the requirements of package.json. You could end up with version 1.0.0 on your local machine and 1.1.0 on your test environment.
Yarn creates a yarn.lock file automatically to make sure you always install the same version of "my_dep". It generates something like this:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install npm-vs-yarn
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page