npm installs packages listed in package.json into node_modules, runs scripts, and publishes packages to the registry.