25 KiB
v6.0.1 (2018-05-09):
AUDIT SHOULDN'T WAIT FOREVER
This will likely be reduced further with the goal that the audit process shouldn't noticibly slow down your builds regardless of your network situation.
MINOR UPDATE FIXES
This lets you update all your modules to the most recent semver compatible
versions without changing the limits in your package.json. This is
helpful when you want your lock to represent what your user's would get. You can do this with:
npm update --depth=99 --save-only-lock
Looking forward
We're still a way from having node@11, so now's a good time to ensure we don't warn about being used with it.
v6.0.1-next.0 (2018-05-03):
CTRL-C OUT DURING PACKAGE EXTRACTION AS MUCH AS YOU WANT!
b267bbbb9npm/lockfile#29lockfile@1.0.4: Switches tosignal-exitto detect abnormal exits and remove locks. (@Redsandro)
SHRONKWRAPS AND LACKFILES
If a published modules had legacy npm-shrinkwrap.json we were saving
ordinary registry dependencies (name@version) to your package-lock.json
as https:// URLs instead of versions.
89102c0d9When saving the lock-file compute how the dependency is being required instead of using_resolvedin thepackage.json. This fixes the bug that was converting registry dependencies intohttps://dependencies. (@iarna)676f1239aWhen encountering ahttps://URL in our lockfiles that point at our default registry, extract the version and use them as registry dependencies. This lets us healpackage-lock.jsonfiles produced by 6.0.0 (@iarna)
AUDIT AUDIT EVERYWHERE
You can't use it quite yet, but we do have a few last moment patches to npm audit to make
it even better when it is turned on!
b2e4f48f5Make sure we hide stream errors on background audit submissions. Previously some classes of error could end up being displayed (harmlessly) during installs. (@iarna)1fe0c7feaInclude session and scope in requests (as we do in other requests to the registry). (@iarna)d04656461Exit with non-zero status when vulnerabilities are found. So you can havenpm auditas a test or prepublish step! (@iarna)fcdbcbaccVerify lockfile integrity before running. You'd get an error either way, but this way it's faster and can give you more concrete instructions on how to fix it. (@iarna)2ac8edd42Refuse to run in global mode. Audits require a lockfile and globals don't have one. Yet. (@iarna)
DOCUMENTATION IMPROVEMENTS
b7fca1084#20407 Update the lock-file spec doc to mention that we now generate the from field forgit-type dependencies. (@watilde)7a6555e61#20408 Describe what the colors in outdated mean. (@teameh)
DEPENDENCY UPDATES
5e56b3209npm-audit-report@1.0.8(@evilpacket)58a0b31b4lock-verify@2.0.2(@iarna)e7a8c364fzkat/pacote#148pacote@8.1.1(@redonkulus)46c0090a5tar@4.4.2(@isaacs)8a16db3e3update-notifier@2.5.0(@alexccl)696375903safe-buffer@5.1.2(@feross)c949eb26aquery-string@6.1.0(@sindresorhus)
v6.0.0 (2018-04-20):
Hey y'all! Here's another npm@6 release -- with node@10 around the corner,
this might well be the last prerelease before we tag 6.0.0! There's two major
features included with this release, along with a few miscellaneous fixes and
changes.
EXTENDED npm init SCAFFOLDING
Thanks to the wonderful efforts of @jdalton of
lodash fame, npm init can now be used to invoke custom scaffolding tools!
You can now do things like npm init react-app or npm init esm to scaffold an
npm package by running create-react-app and create-esm, respectively. This
also adds an npm create alias, to correspond to Yarn's yarn create feature,
which inspired this.
008a83642ed81d1426833046e45#20303 Add annpm initfeature that calls out tonpxwhen invoked with positional arguments. (@jdalton)
DEPENDENCY AUDITING
This version of npm adds a new command, npm audit, which will run a security
audit of your project's dependency tree and notify you about any actions you may
need to take.
The registry-side services required for this command to work will be available on the main npm registry in the coming weeks. Until then, you won't get much out of trying to use this on the CLI.
As part of this change, the npm CLI now sends scrubbed and cryptographically
anonymized metadata about your dependency tree to your configured registry, to
allow notifying you about the existence of critical security flaws. For details
about how the CLI protects your privacy when it shares this metadata, see npm help audit, or read the docs for npm audit
online. You
can disable this altogether by doing npm config set audit false, but will no
longer benefit from the service.
f4bc648ea#20389npm-registry-fetch@1.1.0(@iarna)594d16987#20389npm-audit-report@1.0.5(@iarna)8c77dde741d8ac2492552ff6d6409c734803#20389 Add newnpm auditcommand. (@iarna)be393a290#20389 Temporarily suppress git metadata till there's an opt-in. (@iarna)8e713344f#20389 Document the new command. (@iarna)- #20389 Default audit to off when running the npm test suite itself. (@iarna)
MORE package-lock.json FORMAT CHANGES?!
820f74ae2#20384 Addfromfield back into package-lock for git dependencies. This will give npm the information it needs to figure out whether git deps are valid, specially when running with legacy install metadata or in--package-lock-onlymode when there's nonode_modules. This should help remove a significant amount of git-related churn on the lock-file. (@zkat)
BUGFIXES
9d5d0a18a#20358npm install-test(akanpm it) will no longer generatepackage-lock.jsonwhen running with--no-package-lockorpackage-lock=false. (@raymondfeng)e4ed976e22facb35fb9c1eb945b#20390 Fix a scenario where a git dependency had a comittish associated with it that was not a complete commitid.npmwould never consider that entry in thepackage.jsonas matching the entry in thepackage-lock.jsonand this resulted in inappropriate pruning or reinstallation of git dependencies. This has been addressed in two ways, first, the addition of thefromfield as described in #20384 means we can exactly match thepackage.json. Second, when that's missing (when working with olderpackage-lock.jsonfiles), we assume that the match is ok. (If it's not, we'll fix it up when a real installation is done.) (@iarna)
DEPENDENCIES
DOCS
a1c77d614#20331 Fix broken link to 'private-modules' page. The redirect went away when the new npm website went up, but the new URL is better anyway. (@vipranarayan14)ad7a5962d#20279 Document the--if-presentoption fornpm run-script. (@aleclarson)
v6.0.0-next.1 (2018-04-12):
NEW FEATURES
a9e722118#20256 Add support for managing npm webhooks. This brings over functionality previously provided by thewombatCLI. (@zkat)8a1a64203#20126 Addnpm citcommand that's equivalent ofnpm ci && npm tthat's equivalent ofnpm it. (@SimenB)fe867aaf149d18b4d8ff6b31f7778eab3cdaTherequiresfield in your lock-file will be upgraded to use ranges from versions on your first use of npm. (@iarna)cf4d7b4de#20257 Add shasum and integrity to the newnpm viewoutput. (@zkat)
BUG FIXES
-
685764308Fix a bug where OTPs passed in via the commandline would have leading zeros deleted resulted in authentication failures. (@iarna) -
8f3faa3236800f76ffec90c06c7825b5d2c64785f13fbbd16485f5Restore the ability to bundle dependencies that are uninstallable from the registry. This also eliminates needless registry lookups for bundled dependencies.Fixed a bug where attempting to install a dependency that is bundled inside another module without reinstalling that module would result in ENOENT errors. (@iarna)
-
429498a8c#20029 Allow packages with non-registry specifiers to follow the fast path that the we use with the lock-file for registry specifiers. This will improve install time especially when operating only on the package-lock (--package-lock-only). (@zkat)Fix the a bug where
npm i --only=prodcould remove development dependencies from lock-file. (@iarna) -
834b46ff4#20122 Improve the update-notifier messaging (borrowing ideas from pnpm) and eliminate false positives. (@zkat) -
f9de7ef3a#20154 Let version succeed whenpackage-lock.jsonis gitignored. (@nwoltman) -
f8ec52073#20212 Ensure that we only create anetcdirectory if we are actually going to write files to it. (@buddydvd) -
ab489b753#20140 Note in documentation thatpackage-lock.jsonversion gets touched bynpm version. (@srl295) -
857c2138d#20032 Fix bug where unauthenticated errors would get reported as both 404s and 401s, i.e.npm ERR! 404 Registry returned 401. In these cases the error message will now be much more informative. (@iarna) -
d2d290bca#20082 Allow optional @ prefix on scope withnpm teamcommands for parity with other commands. (@bcoe) -
b5babf0a9#19580 Improve messaging when two-factor authentication is required while publishing. (@jdeniau) -
471ee1c5b0da38b7b4Fix a bug where optional status of a dependency was not being saved to the package-lock on the initial install. (@iarna) -
b3f98d8ba9dea95e31Ensure that--no-optionaldoes not remove optional dependencies from the lock-file. (@iarna)
MISCELLANEOUS
DEPENDENCY UPDATES
73dc97455zkat/cipm#46libcipm@1.6.2: Detect binding.gyp for default install lifecycle. Let'snpm ciwork on projects that have their own C code. (@caleblloyd)77c3f7a00iferr@1.0.0dce733e37zkat/json-parse-better-errors#1json-parse-better-errors@1.0.2(@Hoishin)c52765ff3readable-stream@2.3.6(@mcollina)e160adf9fupdate-notifier@2.4.0(@sindersorhus)9a9d7809emarked@0.3.1(@joshbruce)f2fbd8577#20256figgy-pudding@2.0.1(@zkat)44972d53d#20256libnpmhook@3.0.0(@zkat)cfe562c58#20276node-gyp@3.6.23c0bbcb8ezkat/npx#172libnpx@10.1.1(@jdalton)0573d91e5zkat/cacache#128cacache@11.0.1(@zkat)396afa99ffiggy-pudding@3.1.0(@zkat)e7f869c36pacote@8.0.0(@zkat)77dac72dfssri@6.0.0(@zkat)0b802f2a0retry@0.12.0(@iarna)4781b64bclibnpmhook@4.0.1(@zkat)7bdbaeea6npm-package-arg@6.1.0(@zkat)5f2bf4222read-package-tree@5.2.1(@zkat)
v6.0.0-0 (2018-03-23):
Sometimes major releases are a big splash, sometimes they're something
smaller. This is the latter kind. That said, we expect to keep this in
release candidate status until Node 10 ships at the end of April. There
will likely be a few more features for the 6.0.0 release line between now
and then. We do expect to have a bigger one later this year though, so keep
an eye out for npm@7!
BREAKING AVOID DEPRECATED
When selecting versions to install, we now avoid deprecated versions if possible. For example:
Module: example
Versions:
1.0.0
1.1.0
1.1.2
1.1.3 (deprecated)
1.2.0 (latest)
If you ask npm to install example@~1.1.0, npm will now give you 1.1.2.
By contrast, if you installed example@~1.1.3 then you'd get 1.1.3, as
it's the only version that can match the range.
BREAKING UPDATE AND OUTDATED
When npm install is finding a version to install, it first checks to see
if the specifier you requested matches the latest tag. If it doesn't,
then it looks for the highest version that does. This means you can do
release candidates on tags other than latest and users won't see them
unless they ask for them. Promoting them is as easy as setting the latest
tag to point at them.
Historically npm update and npm outdated worked differently. They just
looked for the most recent thing that matched the semver range, disregarding
the latest tag. We're changing it to match npm install's behavior.
3aaa6ef42Make update and outdated respect latest interaction with semver as install does. (@iarna)e5fbbd2c9npm-pick-manifest@2.1.0(@iarna)
PLUS ONE SMALLER PATCH
Technically this is a bug fix, but the change in behavior is enough of an edge case that I held off on bringing it in until a major version.
When we extract a binary and it starts with a shebang (or "hash bang"), that is, something like:
#!/usr/bin/env node
If the file has Windows line endings we strip them off of the first line. The reason for this is that shebangs are only used in Unix-like environments and the files with them can't be run if the shebang has a Windows line ending.
Previously we converted ALL line endings from Windows to Unix. With this patch we only convert the line with the shebang. (Node.js works just fine with either set of line endings.)
8146583717265198ebbin-links@1.1.2: Only rewrite the CR after a shebang (if any) when fixing up CR/LFs. (@iarna)
BREAKING SUPPORTED NODE VERSIONS
Per our supported Node.js policy, we're dropping support for both Node 4 and Node 7, which are no longer supported by the Node.js project.