This week npm@6 is going to be promoted to latest and so now is an excellent time to look forward. If you dig into it you’ll find that it doesn’t have much in the way of breaking changes. Later this year we’ll be releasing npm@7. First there are a few new features, these will initially ship as npm@6 minor releases:
npm install will be updated to be an alias for npm ci when they would produce the same result, that is, that your package-lock is compatible with your package.json and you’re starting with no node_modules.The breaking changes in npm@7 should not be disruptive but are important:
npm login and npm adduser will finally be split apart. Up till now they’ve been the same command, which is why npm login prompted for an email address.npm init will be getting an overhaul, both with allowing easy third-party init templates and with some new one’s from us, to help you configure your CI and git environments.sudo and how it handles permissions as root to make it less surprising. Look for a new RFC soon!npm link rewrite as described in its associated RFC.preinstall, install and postinstall scripts when running for a dependency will have their output captured and it will only be displayed if there’s an error. They will run with stdin closed. This means that install lifecycle scripts in projects installed as dependencies will not be able to be interactive. For all other lifecycle scripts, output will be captured and routed to the log and also outputted to stdout.After npm@7, in the late summer and fall of 2018, our plans are somewhat more tentative, but we have a few things we’d like to get out to you all:
npx has been a huge success, but it can mean that you’re running untrusted code from the registry. We have a number of thoughts about how to improve its security, from looking for known vulnerabilities to catching typo-squatting.shrinkpack into npm directly. This would allow for entirely offline deploys even without a cache. It will also let you deploy with git dependencies without having git installed on your production machines.npm install and npm ci. If one fails due to certain classes of error then we should try the other.npm init auto?)As we work our way through the year we will likely be rewriting a number of other components in npm, either as we need them or as the community provides them.
npm outdated could use with a rewrite as it has the hackiest of shims to make it work at all. It was originally designed to run off of read-installed output which is what npm@1 and npm@2 used to read node_modules. A version that was designed to run off of modern npm data structures would be much easier to understand.npm ls would benefit a great deal from being updated to work off of modern data structures.npm-registry-client (and in turn request) from the npm code base. With the advent of npm-registry-fetch (which is based off make-fetch-happen and in turn node-fetch) we can finally complete this.For more…
Watch this blog, follow @npmjs on Twitter and subscribe to our newsletter!
If you want to follow development as it happens the best place to go is #js-npm on the package.commmunity discord.