npm 7 is here. The new version of the CLI changes some of the popular Package Manager and has been in work for a long time. But the update also brings a lot of new features, including workspaces and the automatic management of peer dependencies.
npm 7 can be used immediately. The major update, which integrates numerous new features in the popular Package Manager, has long been expected by many developers. The version was announced last year; the features have been tested in a number of beta releases over the past few months. Now the time has come, npm 7 is here. The node integration of the update is planned for Node.js 15, which should be released on October 20th. The numerous changes in npm 7 could soon be available everywhere.
npm 7: New features
One of the highlights in npm 7 is that the Package Manager now supports workspaces. This makes it possible to manage several packages from one top-level package. The new version also includes package-lock v2 and supports yarn.lock. The new package lock format includes everything npm needs to create the package tree. This means that reproducible builds are possible in the future. One of the features that should make it easier to use npm is the changed handling of peer dependencies. These are now installed and managed automatically.
The npm update, however, cannot do without breaking changes. The automatic installation of Peer Dependencies can of course represent a breaking change in workflows that include precisely this step. But there are also big changes: The function of
npxhas changed completely, the command now works with it
npm exec. The output
npm auditgenerated by has also changed.
Further information on npm 7 can be found in the blog posts for the release on npm itself.