"next" 在 package.json 依赖项中究竟意味着什么?
What exactly does "next" mean in package.json dependencies?
next 在 package.json 依赖项中到底是什么意思?
"dependencies": {
"react": "^15.4.2",
"react-dom": "^15.4.2",
"react-router-dom": "next"
}
The next tag is used by some projects to identify the upcoming version.By default, other than latest, no tag has any special significance to npm itself.
具体来说,根据文档,我发现这很有帮助:
By default, the latest tag is used by npm to identify the current
version of a package, and npm install (without any @ or
@ specifier) installs the latest tag. Typically, projects only
use the "latest" tag for stable release versions, and use other tags for
unstable versions such as prereleases.
The next tag is used by some projects to identify the upcoming
version.
By default, other than latest, no tag has any special significance to
npm itself.
因此,例如,我遇到了一些与 npm 本身生成 npm ERR 相关的问题!错误:EACCES:软件包安装时出现权限被拒绝的错误,我首先通过恢复到较早版本的 npm(从 5.4.0 开始)来纠正该错误:
npm install -g npm@5.3.0
但 npm 也是 在其发行版中使用 "next" 标签的软件包之一,因此要在最新但非官方的 "stable version", 你也可以 运行:
npm install -g npm@next
哪个安装了5.5.1
运行:npm show npm versions --json
显示以下版本历史记录,以了解究竟安装了什么:
[ ...
"5.3.0",
"5.4.0",
"5.4.1",
"5.4.2",
"5.5.0",
“5.5.1”
]
这个答案是为了更简单地说明 @next
的目的。文档和其他答案中的语言显得过于复杂。
使用 next
作为版本号将允许 pre-release 版本(如果项目有可用版本)。否则它将允许最新的稳定版本。
next 在 package.json 依赖项中到底是什么意思?
"dependencies": {
"react": "^15.4.2",
"react-dom": "^15.4.2",
"react-router-dom": "next"
}
The next tag is used by some projects to identify the upcoming version.By default, other than latest, no tag has any special significance to npm itself.
具体来说,根据文档,我发现这很有帮助:
By default, the latest tag is used by npm to identify the current version of a package, and npm install (without any @ or @ specifier) installs the latest tag. Typically, projects only use the "latest" tag for stable release versions, and use other tags for unstable versions such as prereleases.
The next tag is used by some projects to identify the upcoming version.
By default, other than latest, no tag has any special significance to npm itself.
因此,例如,我遇到了一些与 npm 本身生成 npm ERR 相关的问题!错误:EACCES:软件包安装时出现权限被拒绝的错误,我首先通过恢复到较早版本的 npm(从 5.4.0 开始)来纠正该错误:
npm install -g npm@5.3.0
但 npm 也是 在其发行版中使用 "next" 标签的软件包之一,因此要在最新但非官方的 "stable version", 你也可以 运行:
npm install -g npm@next
哪个安装了5.5.1
运行:npm show npm versions --json
显示以下版本历史记录,以了解究竟安装了什么:
[ ...
"5.3.0",
"5.4.0",
"5.4.1",
"5.4.2",
"5.5.0",
“5.5.1”
]
这个答案是为了更简单地说明 @next
的目的。文档和其他答案中的语言显得过于复杂。
使用 next
作为版本号将允许 pre-release 版本(如果项目有可用版本)。否则它将允许最新的稳定版本。