yarn, just because it could download the packages from the
npm registery at a faster rate. However, this point is debatable, so let’s not get into that.
Some of the major changes which I want to hightlight in this article and am eagerly looking forward to are:
npm will --saveis available by default now. See the demo with your own eyes.
npmwhile offline will no longer insist on retrying network requests. npm will now immediately fall back to cache if possible, or fail.
--cache-maxhave been deprecated, so, existing npm caches will no longer be used.
--prefer-offlineoption will make npm skip any conditional requests for stale cache data, and only hit the network if something is missing from the cache.
--prefer-onlineoption that will force npm to revalidate cached data, ignoring any staleness checks, and refreshing the cache with revalidated, fresh data.
--offlineoption will force npm to use the cache or exit. It will error with an
ENOTCACHEDcode if anything it tries to install isn’t already in the cache.
package-lock.json), and a new format and semantics for shrinkwrap.
Hopefully, they update their docs quickly with this new update and more users like me will be able to switch or access much of these key features. For detailed look into npm5’s features have a look at their official blog post in which they have listed every other breaking change coming with the new release.
To start using the latest version of npm, you can in your terminal window or preferable shell:
1npm install -g npm@next23# Or45npm install -g npm@latest