【问题标题】:Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) on github actionsfsevents@2.3.2 不支持的平台:在 github 上需要 {"os":"darwin","arch":"any"}(当前:{"os":"linux","arch":"x64"})行动
【发布时间】:2021-08-31 08:42:32
【问题描述】:

我创建了一个 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 添加到可选依赖项中。仍然导致同样的错误。

【问题讨论】:

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


    【解决方案1】:

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

    【讨论】:

    • 是的,这是 nodemon 的错误。我删除并重新安装了 nodemon。
    • 我尝试了这个版本的 nodemon,但它降级了我的 fsevents 和 chokidar 并在其他包中创建了新的警告。
    • 与@smartblonde 完全相同。产生更多警告
    【解决方案2】:

    我在使用 GitHub Action 任务在 Azure 静态 Web 应用中部署 Vue 应用程序时遇到了这个问题。

    运行 npm audit fix 并推送更改后的 package-lock.json 为我解决了问题。

    【讨论】:

      猜你喜欢
      • 2019-09-29
      • 2023-03-13
      • 2020-02-20
      • 1970-01-01
      • 2017-06-08
      • 2021-10-05
      • 1970-01-01
      • 2021-05-11
      • 2014-03-07
      相关资源
      最近更新 更多