簡體   English   中英

創建一個新的 angular 項目記錄 NPM 警告:npm WARN optional SKIPPING OPTIONAL DEPENDENCY

[英]Create a new angular project logs NPM Warnings: npm WARN optional SKIPPING OPTIONAL DEPENDENCY

當我創建一個新的 Angular 項目時,我收到了來自 NPM 的這些警告:

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

似乎它們無關緊要,因為該項目可以與ng serve -o 有沒有辦法關閉這些?

這是我的ng --version結果:

            Angular CLI: 8.3.0-rc.0
            Node: 12.6.0
            OS: linux x64
            Angular: 8.2.2
            ... animations, common, compiler, compiler-cli, core, forms
            ... language-service, platform-browser, platform-browser-dynamic
            ... router

            Package                           Version
            -----------------------------------------------------------
            @angular-devkit/architect         0.802.2
            @angular-devkit/build-angular     0.802.2
            @angular-devkit/build-optimizer   0.802.2
            @angular-devkit/build-webpack     0.802.2
            @angular-devkit/core              8.2.2
            @angular-devkit/schematics        8.3.0-rc.0
            @angular/cdk                      8.1.3
            @angular/cli                      8.3.0-rc.0
            @angular/material                 8.1.3
            @ngtools/webpack                  8.2.2
            @schematics/angular               8.3.0-rc.0
            @schematics/update                0.803.0-rc.0
            rxjs                              6.4.0
            typescript                        3.5.3
            webpack                           4.38.0

您可以嘗試將這些選項添加到 npm install 命令中:

--no-optional argument will prevent optional dependencies from being installed. --no-shrinkwrap argument, which will ignore an available package lock or shrinkwrap file and use the package.json instead. --no-package-lock argument will prevent npm from creating a package-lock.json file.

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM