5 Features in npm 10
Published in
10 min read 1 day ago
Details on 5 major changes
Introduction
npm is the package manager for the node.js JavaScript platform. It puts modules in place (node_modules
) so that the node can find them. It also manages dependency conflicts intelligently.
npm is configurable to support a variety of use cases to publish, discover, install, and develop node programs. It has a list of powerful commands.
npm 10 was released on August 31, 2023. The goal for this major release was to standardize appropriate defaults and clean up legacy configurations where possible.
Here is the command to install npm 10:
% npm install -g npm@10
After the installation, npm is at version 10.2.0.
% npm --version
10.2.0
This is the help manual:
% npm --help
npm <command>
Usage:
npm install install all the dependencies in your project
npm install <foo> add the <foo> dependency to your project
npm test run this project's tests
npm run <foo> run the script named <foo>
npm <command> -h quick help on <command>
npm -l display usage info for all commands
npm help <term> search for help on <term>
npm help npm more involved overview
All commands:
access, adduser, audit, bugs, cache, ci, completion,
config, dedupe, deprecate, diff, dist-tag, docs, doctor,
edit, exec, explain, explore, find-dupes, fund, get, help,
help-search, hook, init, install, install-ci-test,
install-test, link, ll, login, logout, ls, org, outdated,
owner, pack, ping, pkg, prefix, profile, prune, publish,
query, rebuild, repo, restart, root, run-script, sbom,
search, set, shrinkwrap, star, stars, start, stop, team,
test, token, uninstall, unpublish, unstar, update, version,
view, whoami
Specify configs in the ini-formatted file:
/Users/jenniferfu/.npmrc
or on the command line via: npm <command> --key=value
More configuration info: npm help config
Configuration fields: npm help 7 config
[email protected] /Users/jenniferfu/.nvm/versions/node/v21.1.0/lib/node_modules/npm
npm 10 upgrade can be performed for any supported node version, ^18.17.0 || >=20.5.0
.