12

我一直在尝试将我的应用程序部署到 vercel 一段时间,并且一直在阅读有关 stackoverflow 的许多帖子,其中存在相同/相似的fsevents问题。尽管我不断收到下面发布的相同错误。

我尝试过的事情:

  • 卸载node_modules& package-lock.json,然后运行:npm i -f
  • "optionalDependencies": {"fsevents": "^2.3.2"},然后npm i -f
  • fsevents不安装package.json
  • ...以及许多其他尝试

我的部署中总是发生的事情的屏幕截图

我不太熟悉整个 fsevents/chokidar 包的内容/原因,但在我阅读完之后,我的 MacOS 似乎需要它,我真的很感激解决这个问题的一些想法。

在此处输入图像描述

当前 package.json

{
  "name": "my-app",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "eslint .",
    "lint:fix": "eslint --fix ."
  },
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "src/**/*.{js,jsx,ts,tsx}": [
      "prettier --write",
      "eslint --fix ."
    ]
  },
  "dependencies": {
    "firebase": "^8.2.5",
    "firebase-admin": "^9.4.2",
    "firebase-functions": "^3.13.1",
    "fsevents": "^2.3.2",
    "js-cookies": "^1.0.4",
    "next": "10.0.6",
    "next-pwa": "^5.0.5",
    "nookies": "^2.5.2",
    "react": "17.0.1",
    "react-dom": "17.0.1",
    "react-redux": "^7.2.2",
    "redux": "^4.0.5",
    "redux-thunk": "^2.3.0",
    "styled-components": "^5.2.1"
  },
  "optionalDependencies": {
    "fsevents": "^2.3.2"
  },
  "devDependencies": {
    "@types/node": "^14.14.25",
    "@types/react": "^17.0.1",
    "@types/react-redux": "^7.1.16",
    "@types/styled-components": "^5.1.7",
    "babel-eslint": "^9.0.0",
    "eslint": "^6.8.0",
    "eslint-config-airbnb": "^18.2.1",
    "eslint-config-nextjs": "^1.0.7",
    "eslint-config-prettier": "^4.3.0",
    "eslint-plugin-html": "^5.0.5",
    "eslint-plugin-import": "^2.22.1",
    "eslint-plugin-jsx-a11y": "^6.4.1",
    "eslint-plugin-prettier": "^3.3.1",
    "eslint-plugin-react": "^7.22.0",
    "eslint-plugin-react-hooks": "^1.7.0",
    "husky": "^4.3.8",
    "lint-staged": "^10.5.3",
    "prettier": "^1.19.1",
    "redux-devtools-extension": "^2.13.8",
    "typescript": "^4.1.3",
    "webpack": "^5.21.1"
  }
}

4

1 回答 1

9

很多人抱怨这要追溯到几年前。

有时修复是升级到更新的 npm。(运行 npm 7.7 并且仍然拥有它)

通常修复只是:

npm install -f

所以强迫它在这里工作得很好。

于 2021-05-11T04:02:35.253 回答