节点更新特定的包 [英] Node update a specific package
问题描述
我想更新浏览器同步而不更新所有节点包。我怎样才能做到这一点?我当前版本的浏览器同步没有浏览器同步GUI:($ / b>
I want to update my Browser-sync without updating all my node packages. How can I achieve this? My current version of Browser-sync does not have the Browser-sync GUI :(
├─┬ browser-sync@1.9.2
│ ├── browser-sync-client@1.0.2
推荐答案
大多数情况下,您只需更新这样的模块即可获取(尊重package.json中指定的semver)(< - 再次阅读最后一部分):
Most of the time you can just update a module like this to get the latest non breaking changes (respecting the semver specified in your package.json) (<-- read that last part again):
npm update browser-sync
- 使用
npm过期
查看哪些模块具有较新版本
- 使用
npm update
(没有包名称)更新所有模块
- 如果你想要包含
- save-dev
将新版本号保存到您的package.json中。
- Use
npm outdated
to see which modules have newer versions- Use
npm update
(without a package name) to update all modules- Include
--save-dev
if you want to save the newer version numbers to your package.json.
你想要t他的下一个主要版本(v2.x.x)很可能会发生重大变化,您需要更新您的应用以适应这些变化。您可以通过以下方式安装/保存最新的 2.xx
:
In your case, it looks like you want the next major version (v2.x.x), which is likely to have breaking changes and you will need to update your app to accommodate those changes. You can install/save the latest 2.x.x
by doing:
npm install browser-sync@2 --save-dev
...或最新的 2.1.x
做:
npm install browser-sync@2.1 --save-dev
...或最新最棒的 / p>
...or the latest and greatest by doing:
npm install browser-sync@latest --save-dev
注意:最后一个与此相同:
Note: the last one is no different than doing this:
npm uninstall browser-sync --save-dev
npm install browser-sync --save-dev
- save-dev
部分很重要。这将卸载它,从你的package.json中移除值,然后重新安装最新版本并将新值保存到你的package.json中。如果省略 - save-dev
部分,它与上面运行更新命令没有区别。
The --save-dev
part is important. This will uninstall it, remove the value from your package.json, and then reinstall the latest version and save the new value to your package.json. If you omit the --save-dev
part, it's no different than running the update command above.
这篇关于节点更新特定的包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!