如何解决npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13

How to solve npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13

如果我尝试安装新库,我会收到此警告。而且那个库没有安装

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\watchpack-chokidar2\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})    
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\@angular\compiler-cli\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})    
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})     
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\webpack-dev-server\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})    
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\karma\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

"dependencies": {
        "@angular/animations": "^8.2.0",
        "@angular/common": "^8.2.0",
        "@angular/compiler": "^8.2.0",
        "@angular/core": "^8.2.0",
        "@angular/forms": "^8.2.0",
        "@angular/platform-browser": "^8.2.0",
        "@angular/platform-browser-dynamic": "^8.2.0",
        "@angular/router": "^8.2.0",
        "@ng-select/ng-select": "^3.6.2",
        "@swimlane/ngx-datatable": "^15.0.0",
        "angular2-draggable": "^2.3.2",
        "bootstrap": "^3.3.7",
        "core-js": "^2.5.4",
        "eonasdan-bootstrap-datetimepicker": "^4.17.47",
        "font-awesome": "^4.7.0",
        "jquery": "^3.3.1",
        "jspdf": "1.4.1",
        "jspdf-autotable": "^2.3.4",
        "material-icons": "^0.3.1",
        "moment": "^2.24.0",
        "mydatepicker": "^2.6.6",
        "ng2-date-picker": "^8.0.0",
        "ngx-bootstrap": "^4.3.0",
        "ngx-json-viewer": "^2.4.0",
        "ngx-toastr": "^11.3.3",
        "node-sass": "^4.14.1",
        "pretty-checkbox": "^3.0.3",
        "rxjs": "^6.5.1",
        "save": "^2.3.2",
        "sweetalert2": "^8.10.3",
        "underscore": "^1.9.1",
        "zone.js": "~0.9.1"
    },
    "devDependencies": {
        "@angular-devkit/build-angular": "^0.803.28",
        "@angular/cli": "^8.2.0",
        "@angular/compiler-cli": "^8.2.0",
        "@angular/language-service": "^8.2.0",
        "@types/datatables.net": "^1.10.14",
        "@types/jasmine": "~2.8.8",
        "@types/jasminewd2": "~2.0.3",
        "@types/jquery": "^3.3.29",
        "@types/node": "~8.9.4",
        "codelyzer": "^5.2.2",
        "jasmine-core": "~2.99.1",
        "jasmine-spec-reporter": "~4.2.1",
        "karma": "^5.1.0",
        "karma-chrome-launcher": "~2.2.0",
        "karma-coverage-istanbul-reporter": "~2.0.1",
        "karma-jasmine": "~1.1.2",
        "karma-jasmine-html-reporter": "^0.2.2",
        "protractor": "^7.0.0",
        "ts-node": "~7.0.0",
        "tslint": "~5.11.0",
        "typescript": "~3.5.0"
    }

这应该不是问题,它是 OSX mac 依赖项,因此只需要在使用该操作系统时安装。

我正在网上阅读,您可以使用以下命令强制安装,但我不担心

npm install -f

如果您愿意,您也可以将它添加到 .package.json 中的 "optionalDependencies": [] 并进行全新安装,这应该会抑制警告,但您需要确保获得正确的版本.

这是可选的。除非您在 Mac 上进行开发,否则您不需要它。忽略它。