简体   繁体   English

Polymer和npm,更新至最新版本

[英]Polymer and npm, update to latest version

I think this is more an npm than a Polymer question. 我认为这是一个多聚合物问题的NPM。 I have a quite large Polymer project, which is now up to version 1.3.0 according to bower.json inside the Polymer folder. 我有一个很大的Polymer项目,根据Polymer文件夹中的bower.json,它现在的版本为1.3.0。

I have been "offline" from this project for about 2 months and now I realized that the Polymer framework is 1.6.0 我已经从这个项目“脱机”了大约2个月,现在我意识到Polymer框架是1.6.0

How can I update to Polymer 1.6.0 using npm? 如何使用npm更新到Polymer 1.6.0? How can I update all existing components already installed in my project? 如何更新项目中已经安装的所有现有组件?

All you need to do is update your package.json to contain the latest Polymer version, like so: 您需要做的就是更新package.json以包含最新的Polymer版本,如下所示:

"dependencies": {
    "polymer": "~1.6.0"
}

Then, run npm update --save (see the documentation here ) which will find the latest version compatible with ~1.6.0 (eg 1.6.1 ) and save it in your dependencies. 然后,运行npm update --save (请参阅此处文档 ),它将找到与~1.6.0 (例如1.6.1 )兼容的最新版本,并将其保存在依赖项中。

If you're not sure what the latest version is, you can "cheat" and set the dependency to "*" in your package.json , then run npm update --save . 如果不确定最新版本,可以在package.json “作弊”并将依赖项设置为"*" ,然后运行npm update --save This will automatically find the latest version and save it in your package.json . 这将自动找到最新版本并将其保存在package.json

You might also find npm outdated useful - it will identify outdated dependencies in your package.json for you to upgrade. 您可能还会发现npm outdated有用-它会在package.json标识过时的依赖项以供您升级。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM