fsevents@2.3.2 不受支持的平台:在 github 上想要 {"os":"darwin","arch":"any"}(当前:{"os":"linux","arch":"x64"})动作

时间:2021-06-15 13:30:07

标签: node.js linux npm github-actions fsevents

我已经创建了一个 github 操作来在推送时部署代码。

安装软件包时会导致此错误。

Run npm i --no-optional && cd client && npm i --no-optional && cd ..
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! notsup Valid OS:    darwin
npm ERR! notsup Valid Arch:  any
npm ERR! notsup Actual OS:   linux
npm ERR! notsup Actual Arch: x64

npm ERR! A complete log of this run can be found in:

我知道问题出在 fsevents 上。 linux 不支持它。但我安装了这个包。它在我的 package.json 中不可用

    "devDependencies": {
        "@babel/cli": "^7.12.1",
        "@babel/core": "^7.14.0",
        "@babel/node": "^7.13.13",
        "@babel/plugin-transform-runtime": "^7.13.15",
        "@babel/preset-env": "^7.14.1",
        "@types/react-router-dom": "^5.1.7",
        "@types/styled-components": "^5.1.10",
        "antd": "^4.16.2",
        "cross-env": "^7.0.3",
        "eslint": "^7.25.0",
        "eslint-config-prettier": "^8.3.0",
        "eslint-plugin-prettier": "^3.4.0",
        "eslint-plugin-react": "^7.24.0",
        "morgan": "^1.10.0",
        "nodemon": "^2.0.7",
        "prettier": "^2.2.1",
        "react-awesome-reveal": "^3.8.1",
        "react-i18next": "^11.10.0",
        "styled-components": "^5.3.0"
    },
    "dependencies": {
        "@babel/register": "^7.13.16",
        "@babel/runtime": "^7.14.0",
        "bcrypt": "^5.0.1",
        "cookie-parser": "^1.4.5",
        "cors": "^2.8.5",
        "debug": "^4.3.1",
        "dotenv": "^9.0.0",
        "express": "^4.17.1",
        "express-async-handler": "^1.1.4",
        "joi": "^17.4.0",
        "joi-password-complexity": "^5.1.0",
        "jsonwebtoken": "^8.5.1",
        "mongoose": "^5.12.7",
        "object-hash": "^2.1.1",
        "passport": "^0.4.1",
        "passport-jwt": "^4.0.0",
        "passport-local": "^1.0.0",
        "react-autosuggest": "^10.1.0",
        "validator": "^13.6.0"
    }

我尝试在 npm i 时添加非可选参数。并将 fsevent 添加到可选依赖项中。仍然导致同样的错误。

1 个答案:

答案 0 :(得分:0)

我有类似的东西,是由 nodemon 引起的。必须恢复到 nodemon v1.19.4