npm v5.0.0 正式发布,改进了稳定性

npm 5 有了很大的进步,在几乎所有常见的情况下显著地改进了其性能,修复了很多由架构导致的旧的错误,使其更稳定和具有更好的容错性。这对于需要一致性/安全保证的用户是个好消息,新版还为 git 依赖提供了语义化支持。

重大变更:

  • 现有的 npm 缓存将不再使用:您将不得不重新下载全部缓存的软件包。没有任何工具或意图重新使用旧的缓存 (#15666)
  • 不要再使用大写的 npm(npm will now scold you if you capitalize its name. seriously it will fight you.)
  • npm will --save by default now。另外,除非 npm-shrinkwrap.json 存在,否则package-lock.json 将会自动创建 (#15666)
  • 通过 user/repo#semver:^1.2.3,Git 依赖支持语义化 (#15308) (#15666) (@sankethkatta)
  • 移除 Stub 文件 (#16204) (@watilde)
  • “extremely legacy” _token couchToken 已被移除 (#12986)
  • npm install ./packages/subdir will now create a symlink instead of a regular installation. file://path/to/tarball.tgz will not change – only directories are symlinked. (#15900)
  • Git dependencies with prepare scripts will have their devDependencies installed, and npm install run in their directory before being packed.
  • npm cache commands have been rewritten and don’t really work anything like they did before. (#15666)
  • --cache-min and --cache-max have been deprecated. (#15666)
  • Running npm while offline will no longer insist on retrying network requests. npm will now immediately fall back to cache if possible, or fail. (#15666)
  • package locks no longer exclude optionalDependencies that failed to build. This means package-lock.json and npm-shrinkwrap.json should now be cross-platform. (#15900)
  • If you generated your package lock against registry A, and you switch to registry B, npm will now try to install the packages from registry B, instead of A. If you want to use different registries for different packages, use scope-specific registries (npm config set @myscope:registry=https://myownregist.ry/packages/). Different registries for different unscoped packages are not supported anymore.
  • Shrinkwrap and package-lock no longer warn and exit without saving the lockfile.
  • Local tarballs can now only be installed if they have a file extensions .tar, .tar.gz, or .tgz.
  • A new loglevel, notice, has been added and set as default.
  • One binary to rule them all: ./cli.js has been removed in favor of ./bin/npm-cli.js. In case you were doing something with ./cli.js itself. (#12096) (@watilde)
    文章转载自 开源中国社区 [http://www.oschina.net]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值