简体   繁体   中英

Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"}) on github actions

i have created an github action to deploy the code when pushed.

it cause this error when installing the packages.

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:

i know the issue is with the fsevents. it is not supported on linux. but i installed the package. it is not available in my 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"
    }

i tried adding no-optional argument while npm i. and adding fsevent to optional dependencies. still causing same error.

I have something similar and is caused by nodemon. Had to revert to nodemon v1.19.4

I got this problem when using a GitHub Action task to deploy a Vue application in an Azure Static Web App.

Running npm audit fix and pushing the changed package-lock.json solved for me.

You have to remove package.lock.json and than use npm i

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM