Finally, it's out - The NPM 7

Finally, it's out - The NPM 7

·

3 min read

According to npm this the latest update which is coming after a very long time. npm is a package manager for the JavaScript programming language. It is a subsidiary of Github.

How to install npm 7?

Though the latest npm 7 will be coming with node.js next week we can still install by this command.

npm i -g npm@7

Features?

  • Workspace: a set of features to the npm CLI that provides support to managing multiple packages from within a singular top-level, root package

  • Automatically installing peer dependencies: before npm 7 developers needed to manage and install their peer dependencies. The new peer dependency algorithm ensures that a validly matching peer dependency is found at or above the peer-dependent’s location in the node_modules tree.

  • package-lock v2 and support for yarn.lock: Our new package-lock format will unlock the ability to do deterministically reproducible builds and includes everything npm will need to fully build the package tree. Before npm 7 yarn.lock files were ignored, the npm CLI can now use yarn.lock as a source of package metadata and resolution guidance.

ULTIMATE CHANGES

  • First phase of workspaces support is added. This changes npm’s behaviour when a root project’s package.json file contains a workspaces field.
  • Remove --depth config from npm outdated. Only top-level dependencies are shown, unless --all config option is set.
  • The --sso options are deprecated and will print a warning.
  • npm ls : Extraneous dependencies are listed based on their location in the node_modules tree. npm ls only prints the first level of dependencies by default. You can make it print more of the tree by using --depth=<n> to set a specific depth, or --all to print all of them.
  • npm test : When no test is specified, will fail with the missing script: test rather than injecting a synthetic echo 'Error: no test specified' test script into the package.json data.
  • Support for acceptDependencies is added. This can result in dependency resolutions that previous versions of npm will incorrectly flag as invalid.
  • npm dedupe can cause missing or invalid packages to be installed or updated, though it will only do this if required by the stated dependency semantics. Note that the --prefer-dedupe flag has been added, so that you may install in a maximally deduplicated state from the outset.
  • npm rebuild : Runs package installation scripts as well as re-creating links to bins. Properly respects the --ignore-scripts and --bin-links=false configuration options.

Thanks For Reading. 🙌
Source - Github Blog

Did you find this article valuable?

Support Rahul by becoming a sponsor. Any amount is appreciated!