[英]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-react
和eslint-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.