首页 > 解决方案 > 'ESLINT_NO_DEV_ERRORS' 不是内部或外部命令、可运行程序或批处理文件

问题描述

我正在尝试运行具有 Eslint 依赖项的项目的前端。在 package.json 的应用程序启动脚本中,我放置了 ESLINT_NO_DEV_ERRORS=TRUE 标志:

{
 "name": "afectiva-web",
 "version": "1.1.3",
 "private": true,
 "dependencies": {
   "@apollo/client": "^3.3.7",
   "@emotion/react": "^11.1.4",
   "@fortawesome/fontawesome-free": "^5.15.3",
   "@hookform/resolvers": "^1.3.5",
   "@material-ui/core": "^4.11.3",
   "@material-ui/icons": "^4.11.2",
   "@material-ui/lab": "^4.0.0-alpha.58",
   "@sentry/react": "^6.7.2",
   "@sentry/tracing": "^6.7.2",
   "@testing-library/jest-dom": "^5.11.4",
   "@testing-library/react": "^11.1.0",
   "@testing-library/user-event": "^12.1.10",
   "cep-promise": "^4.1.0",
   "cpf": "^2.0.1",
   "date-fns": "^2.21.1",
   "eslint-config-airbnb": "^18.2.1",
   "eslint-plugin-import": "^2.22.1",
   "eslint-plugin-jest": "^24.1.3",
   "eslint-plugin-jsx-a11y": "^6.4.1",
   "eslint-plugin-react": "^7.21.5",
   "eslint-plugin-react-hooks": "^4.2.0",
   "graphql": "^15.5.0",
   "install": "^0.13.0",
   "jquery": "^3.5.1",
   "jsonwebtoken": "^8.5.1",
   "ky": "^0.26.0",
   "mobx": "^6.1.1",
   "mobx-react-lite": "^3.2.0",
   "notistack": "^1.0.3",
   "npm": "^7.11.1",
   "prettier": "^2.2.1",
   "prop-types": "^15.7.2",
   "react": "^17.0.1",
   "react-bootstrap-sweetalert": "^5.2.0",
   "react-dom": "^17.0.1",
   "react-hook-form": "^6.15.4",
   "react-responsive-carousel": "^3.2.18",
   "react-router-dom": "^5.2.0",
   "react-scripts": "4.0.1",
   "react-spring": "9.1.2",
   "recharts": "^2.0.8",
   "simplebar-react": "^2.3.0",
   "socket.io-client": "^4.1.1",
   "subscriptions-transport-ws": "^0.9.18",
   "twilio-video": "^2.8.0",
   "web-vitals": "^0.2.4",
   "yup": "^0.32.8"
 },
 "scripts": {
   "start:build": "ESLINT_NO_DEV_ERRORS=TRUE docker-compose -f ../afectiva-api/docker-compose.yml exec frontend npx serve -s build -p 3000",
   "start": "ESLINT_NO_DEV_ERRORS=TRUE docker-compose -f ../afectiva-api/docker-compose.yaml exec frontend npx react-scripts start",
   "build": "CI=false npx react-scripts build",
   "test": "react-scripts test",
   "eject": "react-scripts eject",
   "generate-build-version": "node generate-build-version",
   "prebuild": "npm run generate-build-version"
 },
 "eslintConfig": {
   "extends": [
     "react-app",
     "react-app/jest"
   ]
 },
 "browserslist": {
   "production": [
     ">0.2%",
     "not dead",
     "not op_mini all"
   ],
   "development": [
     "last 1 chrome version",
     "last 1 firefox version",
     "last 1 safari version"
   ]
 },
 "devDependencies": {
   "eslint-config-prettier": "^7.2.0",
   "eslint-plugin-prettier": "^3.3.1"
 }
}

运行 npm start 命令时,该标志不会被识别为命令。

PS C:\Users\Daniel\afectiva\afectiva-web> npm start

> afectiva-web@1.1.3 start
> ESLINT_NO_DEV_ERRORS=TRUE docker-compose -f ../afectiva-api/docker-compose.yaml exec frontend npx react-scripts start

 'ESLINT_NO_DEV_ERRORS' is not recognized as an internal or external command, operable program, or batch file.

我该怎么办?

我在 Windows 10 中,我的 NodeJS 版本是 v14.13.1,NPM 版本是 7.23.0

标签: javascriptnode.jsreactjsdockereslint

解决方案


推荐阅读