npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents

Scene reappearance

NPM install -- verb when installing dependent

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS:    darwin
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch:  any
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   win32
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64

Explanation of doubts

This is not really a problem, but some of your packages rely on fsevents package, and fsevents package is MacOS system, in Windows/Linux will prompt warning, but will not install

Solutions

However, patients with obsessive-compulsive disorder say that they can’t accept , which means that fsevents is necessary under MacOS and optional under Windows/Linux

Then we can use optional dependencies of package. JSON to avoid warning, and then NPM install -- no optional -- verb do not install options

The references are as follows:

{
    "dependencies": {
        "axios": "^0.18.0",
        "echarts": "^4.2.0-rc.2",
        "element-ui": "^2.4.11",
        "screenfull": "^3.3.3",
        "vue": "^2.5.17",
        "vue-router": "^3.0.1",
        "vuex": "^3.0.1"
    },
    "devDependencies": {
        "@vue/cli-plugin-babel": "^3.0.5",
        "@vue/cli-service": "^3.0.5",
        "less": "^3.0.4",
        "less-loader": "^4.1.0",
        "vue-template-compiler": "^2.5.17"
    },
    "optionalDependencies": {
        "fsevents": "*"
    }
}

Similar Posts: