Cucumber 错误:该";从「;参数的类型必须为字符串。接收未定义

Cucumber 错误:该";从「;参数的类型必须为字符串。接收未定义,cucumber,webdriver-io,Cucumber,Webdriver Io,我正在使用WebDrivero v7(最新稳定版本)和cucumber。 我得到一个错误:error:“from”参数必须是string类型。接收到未定义的 这是堆栈跟踪: 2021-04-08T18:29:37.403Z ERROR @wdio/runner: TypeError [ERR_INVALID_ARG_TYPE]: The "from" argument must be of type string. Received undefined at vali

我正在使用WebDrivero v7(最新稳定版本)和cucumber。
我得到一个错误:
error:“from”参数必须是string类型。接收到未定义的

这是堆栈跟踪:

2021-04-08T18:29:37.403Z ERROR @wdio/runner: TypeError [ERR_INVALID_ARG_TYPE]: The "from" argument must be of type string. Received undefined
    at validateString (internal/validators.js:120:11)
    at Object.relative (path.js:437:5)
    at getDefinitionLineAndUri (C:\my-project\node_modules\cucumber\lib\support_code_library_builder\build_helpers.js:184:27)
    at buildStepDefinitionConfig (C:\my-project\node_modules\cucumber\lib\support_code_library_builder\build_helpers.js:124:7)
    at SupportCodeLibraryBuilder.defineStep (C:\my-project\node_modules\cucumber\lib\support_code_library_builder\index.js:51:79)
    at Object.<anonymous> (C:\my-project\src\step_definitions\/accountSummary_steps.js:6:1)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Module._compile (C:\my-project\node_modules\pirates\lib\index.js:99:24)
    at Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Object.newLoader [as .js] (C:\my-project\node_modules\pirates\lib\index.js:104:7)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Module._load (internal/modules/cjs/loader.js:878:14)
    at Function.hookedLoader [as _load] (C:\my-project\node_modules\mockery\mockery.js:111:12)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at C:\my-project\node_modules\@wdio\cucumber-framework\build\index.js:204:13   
这是我的package.json依赖项:

"dependencies": {
    "@babel/cli": "^7.2.3",
    "@babel/plugin-proposal-export-default-from": "^7.5.2",
    "@babel/preset-env": "^7.4.2",
    "@babel/register": "^7.4.0",
    "@types/cucumber": "^7.0.0",
    "@wdio/cli": "^7.3.1",
    "@wdio/config": "^7.3.1",
    "@wdio/cucumber-framework": "^7.3.1",
    "@wdio/local-runner": "^7.3.1",
    "@wdio/selenium-standalone-service": "^7.3.1",
    "@wdio/spec-reporter": "^7.3.1",
    "@wdio/sync": "^7.3.1",
    "chai": "^4.3.4",
    "cucumber": "^6.0.5",
    "eslint-plugin-wdio": "^7.0.0",
    "file-system": "^2.2.2",
    "mjpeg-consumer": "^2.0.0",
    "node-fetch": "^2.6.1",
    "webdriverio": "^7.3.1",
    "yarn": "^1.22.10"
  },
  "devDependencies": {
    "@babel/core": "^7.4.0",
    "@wdio/allure-reporter": "^7.3.1",
    "@wdio/browserstack-service": "^7.3.1",
    "@wdio/junit-reporter": "^7.3.1",
    "babel-eslint": "^10.1.0",
    "babel-jest": "^26.6.3",
    "eslint": "^7.23.0",
    "eslint-plugin-import": "^2.22.1",
    "forever": "^3.0.4",
    "jest": "^26.6.3",
    "npm-run-all": "^4.1.5"
  }  
有人知道哪里出了问题吗?

谢谢

我通过删除
“cucumber”:“^6.0.5”
依赖项并在
package.json
文件中使用
“@cucucumber/cucucumber”:“^7.1.0”
解决了这个问题。
在我的steps文件中,我导入了如下语句:

import {Then, When} from '@cucumber/cucumber';    
与此相反:

import {Then, When} from 'cucumber';  
这似乎是WebDrivero v7与cucumber整合的新方式。(如中所述)

import {Then, When} from 'cucumber';