新的反應用戶在這里,當我安裝eslint-plugin-react和eslint-plugin-react-hooks.
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '@es-joy/[email protected]',
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: '[email protected]',
npm WARN EBADENGINE required: { node: '^12 || ^14 || ^16' },
npm WARN EBADENGINE current: { node: 'v17.3.0', npm: '8.3.0' }
npm WARN EBADENGINE }
包.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
{
"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"
}
}
有沒有人能幫助我理解這些特定的錯誤?
uj5u.com熱心網友回復:
此錯誤意味著這兩個包需要 Node 12、14 或 16,但您的 Node 版本是 17。
這只是警告,并且軟體包將像其他軟體包一樣正確安裝。但是,可能存在由 Node 版本不匹配導致的錯誤。最好的方法是臨時使用 Node 16(如果你使用 NVM)。
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/411272.html
標籤:
下一篇:運行命令“npmrunbuild”時出錯,錯誤“TypeError:MiniCssExtractPlugin不是建構式”
