next.js npm运行构建错误:Linting和检查类型的有效性...错误:无法找到模块'dots.exe'

neekobn8  于 2023-05-17  发布在  其他
关注(0)|答案(1)|浏览(252)

升级了我的项目的package.json并做了一些审计修复。但现在无法运行构建。尝试了所有的解决方案从stackoverflow和其他论坛,没有一个工作。
这是我的package.json

{
    "name": "my-admin-frontend",
    "version": "0.0.1",
    "author": "",
    "license": "ISC",
    "scripts": {
        "dev": "node server.js",
        "build": "next build ./src",
        "preinstall": "npx npm-force-resolutions",
        "start": "npm run build && node server.js",
        "coverage": "jest",
        "lint": "npm run lint:js && npm run lint:styles",
        "lint:js": "eslint \"./src/pages/*.js\" \"./src/components/**/*.js\" \"./src/adapters/**/*.js\" --fix",
        "lint:styles": "stylelint \"./src/pages/*.js\" \"./src/components/**/*.styles.js\"  \"./src/components/**/*.css\"",
        "check-audit": "npm audit",
        "check-quality": "npm run lint",
        "eslint-report": "eslint --ext .jsx,.js -c .eslintrc.yml -o report.json ./src/components -f json",
        "test": "npm run coverage -- --coverage --watchAll=false"
    },
    "dependencies": {
        "@babel/plugin-proposal-class-properties": "^7.18.6",
        "@date-io/date-fns": "^2.16.0",
        "@material-ui/core": "^4.11.0",
        "@material-ui/icons": "^4.11.3",
        "@material-ui/lab": "^4.0.0-alpha.60",
        "@material-ui/pickers": "^3.2.10",
        "@microsoft/applicationinsights-web": "^2.8.9",
        "@microsoft/microsoft-graph-client": "^3.0.4",
        "applicationinsights": "^2.3.6",
        "axios": "^1.2.1",
        "body-parser": "^1.20.1",
        "cookie": "^0.5.0",
        "cookie-parser": "^1.4.6",
        "date-fns": "^2.29.3",
        "enzyme": "^3.11.0",
        "enzyme-adapter-react-16": "^1.15.7",
        "eslint-config-next": "^13.0.6",
        "express": "^4.18.2",
        "express-session": "^1.17.3",
        "grapesjs": "^0.20.1",
        "grapesjs-preset-webpage": "^1.0.2",
        "helmet": "^6.0.1",
        "hpp": "^0.2.3",
        "identity-obj-proxy": "^3.0.0",
        "jquery": "^3.6.1",
        "js-cookie": "^3.0.1",
        "jwt-decode": "^3.1.2",
        "mobx": "^6.7.0",
        "mobx-react": "^7.6.0",
        "mobx-react-lite": "^3.4.0",
        "next": "^13.0.6",
        "next-images": "^1.8.4",
        "node-fetch": "^3.3.0",
        "passport": "^0.6.0",
        "passport-azure-ad": "^4.3.4",
        "postcss": "^8.4.19",
        "prop-types": "^15.8.1",
        "qrcode.react": "^3.1.0",
        "react": "^18.2.0",
        "react-device-detect": "^2.2.2",
        "react-dom": "^18.2.0",
        "react-idle-timer": "^5.4.2",
        "react-player": "^2.11.0",
        "react-responsive-carousel": "^3.2.23",
        "react-screen-orientation": "0.0.4",
        "react-test-renderer": "^18.2.0",
        "styled-components": "^5.3.6"
    },
    "devDependencies": {
        "@babel/plugin-proposal-decorators": "^7.20.5",
        "@babel/plugin-proposal-optional-chaining": "^7.18.9",
        "@jest/fake-timers": "29.3.1",
        "@wojtekmaj/enzyme-adapter-react-17": "^0.8.0",
        "autoprefixer": "^10.4.13",
        "babel-eslint": "^7.2.3",
        "babel-plugin-styled-components": "^2.0.7",
        "contentful-management": "^10.22.0",
        "dotenv": "^16.0.3",
        "eslint": "^8.29.0",
        "eslint-plugin-jsx-a11y": "^6.6.1",
        "eslint-plugin-react": "^7.31.11",
        "eslint-plugin-react-hooks": "^4.6.0",
        "husky": "^8.0.2",
        "jest": "^29.3.1",
        "jest-enzyme": "^4.2.0",
        "jest-puppeteer": "^6.1.1",
        "junit-report-builder": "^3.0.1",
        "pa11y-ci": "^3.0.1",
        "puppeteer": "^19.4.0",
        "stylelint": "^14.16.0",
        "stylelint-config-recommended": "9.0.0",
        "stylelint-config-styled-components": "0.1.1",
        "stylelint-processor-styled-components": "1.10.0",
        "tailwindcss": "^3.2.4"
    },
    "resolutions": {
        "node-fetch": "2.6.7",
        "object-path": "0.11.5",
        "glob-parent": "5.1.2",
        "set-value": "4.0.1",
        "underscore": "1.13.2",
        "ws": "7.4.6",
        "jest-environment-jsdom": "27.4.6"
    },
    "husky": {
        "hooks": {
            "pre-push": "npm run check-quality"
        }
    },
    "robots": {
        "prod": {
            "userAgent": [
                "*"
            ],
            "allow": [
                "/"
            ]
        },
        "dev": {
            "userAgent": [
                "*"
            ],
            "disallow": [
                "*"
            ],
            "noindex": [
                "*"
            ]
        }
    }
}

我的**.eslintrc.yml**

env:
  browser: true
  node: true
  commonjs: true
  es6: true
  jest: true
extends:
  - eslint:recommended
  - plugin:react/recommended
  - plugin:jsx-a11y/recommended
  - next/core-web-vitals
parser: babel-eslint
parserOptions:
  ecmaFeatures:
    jsx: true
  ecmaVersion: 2018
  sourceType: module
plugins:
  - react
  - jsx-a11y
  - react-hooks
rules:
  react-hooks/rules-of-hooks:
    - error
  react-hooks/exhaustive-deps:
    - warn
  indent:
    - error
    - 4
  semi:
    - error
    - never
  no-console:
    - error
    - allow:
        - error
        - warn
        - info
  object-curly-spacing:
    - error
    - always
  array-bracket-spacing:
    - error
    - never
  jsx-quotes:
    - error
    - prefer-single
  lines-between-class-members:
    - error
    - always
  no-multiple-empty-lines:
    - error
    - max: 1
  react/display-name:
    - off
settings:
  react:
    version: detect

我的**.eslintignore**

out/*
.next/*

我得到的错误是:Linting和检查类型的有效性...错误:无法找到模块'footer'需要堆栈:

  • C:\project test\MT-MyProject\node_modules\eslint\lib\api.js

我在package.json中尝试了多次更改,但都不起作用。我试着清理缓存和安装所有再次,但没有运气。

kxeu7u2r

kxeu7u2r1#

你有没有尝试卸载eslint库,然后尝试使用npm i,然后构建

相关问题