简体   繁体   English

安装 eslint-plugin-react 时不支持的引擎

[英]Unsupported engine, when installing eslint-plugin-react

New react user here, I'm encountering the following error in my terminal when I install eslint-plugin-react and eslint-plugin-react-hooks .这里是新的 react 用户,当我安装eslint-plugin-reacteslint-plugin-react-hooks时,我在终端中遇到以下错误。

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: '@es-joy/jsdoccomment@0.10.8',
npm WARN EBADENGINE   required: { node: '^12 || ^14 || ^16' },
npm WARN EBADENGINE   current: { node: 'v17.3.0', npm: '8.3.0' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'eslint-plugin-jsdoc@36.1.1',
npm WARN EBADENGINE   required: { node: '^12 || ^14 || ^16' },
npm WARN EBADENGINE   current: { node: 'v17.3.0', npm: '8.3.0' }
npm WARN EBADENGINE }

package.json package.json

{
  "name": "postcode-pricing",
  "version": "1.0.0",
  "description": "Lorum Ipsum",
  "main": "index.js",
  "scripts": {
    "build": "wp-scripts build",
    "start": "wp-scripts start",
    "start:custom": "wp-scripts start src/index.js --output-path=admin/build",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "@wordpress/scripts": "^19.2.2",
    "eslint": "^7.32.0",
    "eslint-plugin-react": "^7.28.0",
    "eslint-plugin-react-hooks": "^4.3.0"
  }
}

.eslintrc.json .eslintrc.json

{
  "env": {
    "browser": true,
    "es2021": true
  },
  "extends": ["plugin:react/recommended", "google"],
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "ecmaFeatures": {
      "jsx": true
    },
    "ecmaVersion": 12,
    "sourceType": "module"
  },
  "plugins": ["react", "react-hooks", "@typescript-eslint"],
  "rules": {
    "react-hooks/rules-of-hooks": "error",
    "react-hooks/exhaustive-deps": "warn"
  }
}

Is anyone able to help me make sense of these particular errors?有没有人能帮助我理解这些特定的错误?

This error means that these two packages require Node 12, 14, or 16 but your Node version is 17.此错误意味着这两个包需要 Node 12、14 或 16,但您的 Node 版本是 17。

It is just warnings and packages will be properly installed just like other ones.这只是警告,并且软件包将像其他软件包一样正确安装。 However there might be an error caused by Node version mismatch.但是,可能存在由 Node 版本不匹配导致的错误。 Best way is to temporarily use Node 16(if you use NVM).最好的方法是临时使用 Node 16(如果你使用 NVM)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ESLint:插件“反应”在两者之间发生冲突 - ESLint: Plugin "react" was conflicted between 错误 eslint@5.6.0:引擎“节点”与此模块不兼容。 尝试创建反应应用程序时 - error eslint@5.6.0: The engine "node" is incompatible with this module. when trying to create-react-app @typescript-eslint/eslint-plugin@2.3.2:引擎“节点”与此模块不兼容 - @typescript-eslint/eslint-plugin@2.3.2: The engine “node” is incompatible with this module 安装 React-chartjs-2 Chart.js 时,引擎“节点”与此模块不兼容, - The engine “node” is incompatible with this module when installing React-chartjs-2 Chart.js, 仅在 Docker 中构建时不支持的引擎节点/NPM - Unsupported engine node / NPM only when building in Docker NPM 警告:“不支持的引擎” - NPM warning: 'unsupported engine' 尝试部署 Firebase 函数时,React 中出现 *ESLint 错误* - *ESLint Error* in React when trying to deploy Firebase Functions Node JS-安装插件时npm出现问题 - Node JS - Problems with npm when installing plugin 安装类似ESLint和Babel的插件 - installing plugins like ESLint and Babel ESLint 与 eslint-plugin-import 和 typescript-eslint 冲突 - ESLint conflicts with eslint-plugin-import and typescript-eslint
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM