无法使用节点16.2.0安装 @Testing-library/jest-dom

发布于 2025-02-09 11:25:58 字数 1136 浏览 0 评论 0 原文

删除了节点模块并删除了包装锁文件。之后,尝试进行NPM安装,并导致以下错误。节点版本为16.2.0。运行NPM缓存清洁 - 也可以。

npm err!代码ebadengine npm err!发动机不受支持的发动机 npm err!引擎与您的节点/npm版本不兼容: npm err!需要:{“ node”:“ ^12.13.0 || ^14.15.0 || ^16.10.0 ||> = 17.0.0.0”} npm err! NOTSUP实际:{“ npm”:“ 7.13.0”,“ node”:“ v16.2.0”}

以下是.npmrc文件中的config 引擎 - 图片= true 传统peer-deps = true

甚至尝试卸载开玩笑,但面对相同的错误,

这里是dev依赖性 “ devDectiencies”:{ “@next/bundle-analyzer”:“^12.0.7”, “@testing-library/jest-dom”:“^5.16.2”, “@testing-library/react”:“^12.1.2”, “ autoprefixer”:“^10.2.5”, “ cross-env”:“^7.0.3”, “ eslint”:“ 7.28.0”, “ Eslint-Plugin-react”:“ 7.24.0”,, “沙哑”:“^7.0.1”, “开玩笑”:“^26.6.3”, “绒毛阶段”:“ 11.0.0”, “ MSW”:“^0.38.1”, “ Postcss”:“^8.2.15”, “漂亮”:“^2.4.1”, “ tailwindcss”:“^2.1.2” }

Deleted the node modules and dropped the package-lock file. After that try to do npm install and it results in the below error. Node version is 16.2.0. Ran npm cache clean --force as well.

npm ERR! code EBADENGINE
npm ERR! engine Unsupported engine
npm ERR! engine Not compatible with your version of node/npm: [email protected]
npm ERR! notsup Not compatible with your version of node/npm: [email protected]
npm ERR! notsup Required: {"node":"^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0"}
npm ERR! notsup Actual: {"npm":"7.13.0","node":"v16.2.0"}

Following is the config in .npmrc file
engine-strict=true
legacy-peer-deps=true

Even tried uninstalling jest but was faced with the same error

Here is the dev dependency
"devDependencies": {
"@next/bundle-analyzer": "^12.0.7",
"@testing-library/jest-dom": "^5.16.2",
"@testing-library/react": "^12.1.2",
"autoprefixer": "^10.2.5",
"cross-env": "^7.0.3",
"eslint": "7.28.0",
"eslint-plugin-react": "7.24.0",
"husky": "^7.0.1",
"jest": "^26.6.3",
"lint-staged": "11.0.0",
"msw": "^0.38.1",
"postcss": "^8.2.15",
"prettier": "^2.4.1",
"tailwindcss": "^2.1.2"
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文