【问题标题】:NPM- Dependent package not updatingNPM-依赖包不更新
【发布时间】:2016-01-06 20:46:51
【问题描述】:

我正在使用 grunt-protractor-runner 来下载最新的次要版本的量角器。量角器版本 2.5 https://github.com/angular/protractor/issues/2588 中有一个错误导致我的测试失败。我通过查看我们用于构建的 jenkins 上的日志确认它正在使用该版本

21:56:58 grunt-protractor-runner@2.0.0 node_modules/grunt-protractor-runner
21:56:58 ├── split@0.3.3 (through@2.3.8)
21:56:58 ├── through2@0.5.1 (xtend@3.0.0, readable-stream@1.0.33)
21:56:58 └── protractor@2.5.0 (jasminewd@1.1.0, jasminewd2@0.0.6, html-   entities@1.1.3, q@1.0.0, minijasminenode@1.1.1, optimist@0.6.1, adm-  zip@0.4.4, glob@3.2.11, accessibility-developer-tools@2.6.0, saucelabs@1.0.1, jasmine@2.3.2, source-map-support@0.2.10, request@2.57.0, selenium-webdriver@2.47.0)

Protractor 大约 5 小时前发布了一个新的次要版本 2.5.1,但是当我的构建在 jenkins 上运行时,它仍然拉低 2.5.0。我不明白为什么。我在https://github.com/teerapap/grunt-protractor-runner/blob/master/package.json 查看了 grunt-protractor runner 的 package.json 并将量角器定义为

"dependencies": {
"protractor": "^2.0.0",
"split": "~0.3.0",
"through2": "~0.5.1"
  },

因此,如果我正确理解“^”,它应该会提取最新的次要版本。是否需要做其他事情才能让我的依赖项的依赖项正确下拉?

【问题讨论】:

    标签: jenkins npm protractor


    【解决方案1】:

    当我使用 npm(版本 3.3.3)安装 grunt-protractor-runner 时,会安装 protractor@2.5.1:

    你有两个选择:

    1. 尝试使用 cd project-dir/ && rm -r node_modules/ 删除您的节点模块文件夹,然后重新运行 npm install 以重新安装您的依赖项。
    2. 我安装了grunt-protractor-runner@2.1.0,你有版本2.0.0。尝试更新软件包以查看量角器版本是否随之更新。

    【讨论】:

    • 我将 grunt-protractor-runner 的 json 包从 ~2.0 更新到 ~2 并安装了 npm。然后当进入 node_modules/grunt-protractor-runner 并做了一个 npm install 然后是一个 npm 列表,这就是我得到的 grunt-protractor-runner@2.1.0 /workspaces//node_modules/grunt-protractor-runner ├── grunt@0.4.5 ├── grunt-contrib-clean@0.4.1 ├── grunt-contrib-jshint@0.6.5 ├── grunt-contrib-nodeunit@0.2.2 ├── protractor@2.5 .0 ├── split@0.3.3 └── through2@0.5.1 仍然是 protractor@2.5。我已经做了 rm -r node_modules
    • 为了将来参考,请将您的更新添加到您的原始问题中,因为它更易于阅读。我建议删除你的 node_modules 文件夹,如我的答案的选项 1 中一样,从你的 package.json 中删除 grunt-protractor-runner,然后再次运行 npm install && npm install grunt-protractor-runner --save-dev
    • 好吧,这就是我的想法,然后弹出窗口说如果直接添加 cmets 并认为这是这里的规则。让我试试你的建议
    • 如果是小事,那么对我的回答发表评论就可以了。请注意,我也更新了我之前的评论。
    • 在上面发表了评论/答案
    猜你喜欢
    • 2020-04-30
    • 2021-12-25
    • 1970-01-01
    • 1970-01-01
    • 2019-09-23
    • 2022-11-25
    • 2017-09-13
    • 2015-04-07
    • 1970-01-01
    相关资源
    最近更新 更多