【问题标题】:WebdriverIO : Can we push code with dependencies only installed?WebdriverIO:我们可以推送只安装依赖项的代码吗?
【发布时间】:2020-07-12 16:38:01
【问题描述】:

我正在使用 webdriverIO v6

我只安装了这两个包:npm install @wdio/cli 和 webdriverio

我在本地的测试进展顺利。

可以在 git 中推送到代码仓库吗,这在 Jenkis 或 Azure devops 中有效吗?

还是需要安装 --save-dev 才能在 CI 工具中工作?

{
  "name": "test-package",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "wdio": "./node_modules/.bin/wdio wdio.conf.js"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "@wdio/allure-reporter": "^6.1.23",
    "@wdio/cli": "^6.1.25",
    "@wdio/local-runner": "^6.1.25",
    "@wdio/mocha-framework": "^6.1.19",
    "@wdio/spec-reporter": "^6.1.23",
    "@wdio/sync": "^6.1.14",
    "chromedriver": "^83.0.1",
    "wdio-chromedriver-service": "^6.0.3",
    "webdriverio": "^6.1.25"
  },
  "dependencies": {}
}

【问题讨论】:

    标签: webdriver-io


    【解决方案1】:

    这不是 wdio 特有的。这是一个在 nodejs 上下文中已经讨论过多次的问题。

    由于各种合乎逻辑的原因,许多开发人员建议不要在 repo 中包含 node_modules。然后有一些原因可能会迫使你这样做。如果您这样做只是为了减少构建时间,请为其他影响做好准备。以下是可能对您有所帮助的链接。

    https://flaviocopes.com/should-commit-node-modules-git/

    Should "node_modules" folder be included in the git repository

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-07-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多