为 Windows 使用 NVM 更新 node.js
Updating node.js with NVM for Windows
我一直在我的系统上使用 NVM for Windows 到 运行 两个版本的 Node,最新版本和 LTS 版本。但是,自从安装了 NVM 之后,我还没有更新过 Node。我想将这两个版本更新到它们当前的迭代版本(撰写本文时为 11.5.0 和 10.14.2),理想情况下不必为每个版本重新安装我的所有全局包。我知道原始的 NVM 具有 --reinstall-packages-from
标志的这种功能,但它看起来不像 NVM 中的 Windows.
有任何类似的东西
你说得对,Windows 的 NVM 中没有任何相似之处。如果它对您有用,您可以随时通过在 github 页面上打开问题来请求它。
听起来您已经知道 如何 安装 11.5.0 和 10.14.2,一旦您知道了,运行 nvm use 11
或 nvm use 10
将自动 select 最新的适当版本(但您仍然需要手动重新安装任何全局包)。
这可能是一个盘点全球包裹的机会,它们往往造成的麻烦多于它们的价值。 (一般,安装的全局包越少越好。)
设计不支持
https://github.com/coreybutler/nvm-windows/issues/236
NVM4W provides a more minimalistic approach, focusing on node version
management, not npm management. NVM4W leaves workflow customization to
the end user... because a) it's not hard, and b) it's very
opinionated.
The statement "switching node version needs reinstallation of all
packages in most cases" is unsubstantiated. This doesn't mean it's not
true, but there aren't any stats to back this claim. There are plenty
of use cases where this is not the case, such as developing original
modules with forward/backwards compatibility.
Third, automating this process, either forcibly or by default, has a
number of unintended consequences in a Windows environment. See the
Roaming Profiles use case for an example.
Even if this were a non-default optional command, it still strays from
node version management into npm management. This is an entirely
different problem (and a much bigger problem).
我一直在我的系统上使用 NVM for Windows 到 运行 两个版本的 Node,最新版本和 LTS 版本。但是,自从安装了 NVM 之后,我还没有更新过 Node。我想将这两个版本更新到它们当前的迭代版本(撰写本文时为 11.5.0 和 10.14.2),理想情况下不必为每个版本重新安装我的所有全局包。我知道原始的 NVM 具有 --reinstall-packages-from
标志的这种功能,但它看起来不像 NVM 中的 Windows.
你说得对,Windows 的 NVM 中没有任何相似之处。如果它对您有用,您可以随时通过在 github 页面上打开问题来请求它。
听起来您已经知道 如何 安装 11.5.0 和 10.14.2,一旦您知道了,运行 nvm use 11
或 nvm use 10
将自动 select 最新的适当版本(但您仍然需要手动重新安装任何全局包)。
这可能是一个盘点全球包裹的机会,它们往往造成的麻烦多于它们的价值。 (一般,安装的全局包越少越好。)
设计不支持
https://github.com/coreybutler/nvm-windows/issues/236
NVM4W provides a more minimalistic approach, focusing on node version management, not npm management. NVM4W leaves workflow customization to the end user... because a) it's not hard, and b) it's very opinionated.
The statement "switching node version needs reinstallation of all packages in most cases" is unsubstantiated. This doesn't mean it's not true, but there aren't any stats to back this claim. There are plenty of use cases where this is not the case, such as developing original modules with forward/backwards compatibility.
Third, automating this process, either forcibly or by default, has a number of unintended consequences in a Windows environment. See the Roaming Profiles use case for an example.
Even if this were a non-default optional command, it still strays from node version management into npm management. This is an entirely different problem (and a much bigger problem).