错误Selenium-webdriver@4.5.0:引擎"节点"与此模块不兼容。预期版本">= 14.20.0"。得到"14.17.4"



在我工作的这个分支中,我一直在做一场噩梦,把依赖项整理好。今天我终于把所有东西都处理好了,我在GitLab中的管道也通过了。就上下文而言,该项目是一个使用Expo的React Native应用程序。

因此,由于我在这个分支中完成了所有工作,我将其合并到develop中。但是现在,当我尝试在develop分支中运行yarn时,我会得到以下错误:

error selenium-webdriver@4.5.0: The engine "node" is incompatible with this module. Expected version ">= 14.20.0". Got "14.17.4"
error Found incompatible module.

我以前在我的另一个分支中遇到过这个错误,并按照它所说的做了,并将我的Node升级为v14.20.0,但当我这样做时,它弊大于利,并导致了无数的TypeScript问题。

我的模块安装位置有一些问题,所以使用了nohoist,这似乎起到了作用,然后我回到节点v14.17.4,一切似乎都正常。但现在,在将该分支合并到develop之后,develop就不再工作了。

这是我的package.json:

{
"name": "oml",
"private": true,
"scripts": {
"start": ": You are in the project root. cd into the relevant package and run yarn start to start that package.",
"prepare": "husky install",
"docs": "yarn workspace @oml/types docs",
"test:commit": "yarn workspaces run test:commit",
"test:ci": "yarn workspaces run test:ci",
"check-code": "yarn workspaces run check-code",
"build:web": "cd apps/trader-portal && expo build:web --non-interactive && rm -rf ../firebase/web-build && mv web-build ../firebase/",
"build:android": "cd apps/trader-portal && expo build:android -t app-bundle --non-interactive --no-wait --release-channel",
"build:ios": "cd apps/trader-portal && expo build:ios --non-interactive --no-wait --release-channel"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.29.3",
"@typescript-eslint/parser": "^4.29.3",
"concurrently": "^6.3.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-jest": "^24.4.0",
"eslint-plugin-react": "^7.26.0",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-react-native": "^3.11.0",
"husky": "^7.0.4",
"open-cli": "^7.0.1",
"prettier": "2.3.2",
"typescript": "4.8.4"
},
"workspaces": {
"packages": [
"./packages/*",
"./apps/**"
],
"nohoist": [
"**/@react-native-community",
"**/@react-native-community/**"
]
}
}

编辑

我想说的是,我不知道为什么会出现这个错误,因为在我出现这个错误之前,我从未听说过selenium-webdriver。在我的项目中,我没有直接提到它。

根据stackerflow中的其他一些答案,您可以忽略yarn add "library name" --ignore-engines的错误

我也遇到了同样的问题,我解决了这个问题,更新了节点版本14.20.0,错误是怎么说的。

检查管道和本地之间的节点版本。

最新更新