【问题标题】:the type of schema applied to the document is not supported package.json不支持应用于文档的架构类型 package.json
【发布时间】:2018-12-31 03:42:13
【问题描述】:

谁能解释我的 package.json 文件中的这个警告是什么?我进行了一些搜索,但我似乎无法理解这是否只是兼容性/奇怪的行为,或者是否有比这更糟糕的事情发生。

我已经截取了下面的警告消息。 如果这已在其他地方得到回答并且我忽略了它,我深表歉意。

附上我的 package.json 全文:

{
    "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
    "version": 1,
    "projects": {
        "project": {
            "architect": {
                "lint": {
                    "builder": "@angular-devkit/build-angular:tslint",
                    "options": {
                        "exclude": [ "**/node_modules/**" ],
                        "tsConfig": [ "tsconfig.json" ]
                    }
                },
                "build": {
                    "builder": "@angular-devkit/build-angular:browser",
                    "options": {
                        "aot": true,
                        "assets": [ "src/favicon.ico" ],
                        "index": "src/index.html",
                        "main": "src/main.ts",
                        "outputPath": "dist",
                        "polyfills": "src/polyfills.ts",
                        "scripts": [
                            "node_modules/uikit/dist/js/uikit.min.js",
                            "node_modules/uikit/dist/js/uikit-icons.min.js"
                        ],
                "styles": [
                "node_modules/uikit/dist/css/uikit.min.css",
                "src/styles.scss",
                "node_modules/bootstrap/dist/css/bootstrap.min.css"
                ],
                        "tsConfig": "tsconfig.json"
                    },
                    "configurations": {
                        "development": {
                            "baseHref": "/aspnetcoreangular/",
                            "buildOptimizer": true,
                            "extractCss": true,
                            "extractLicenses": true,
                            "namedChunks": false,
                            "optimization": true,
                            "outputHashing": "all",
                            "sourceMap": false,
                            "vendorChunk": false
                        },
                        "production": {
                            "fileReplacements": [
                                {
                                    "replace": "src/environments/environment.ts",
                                    "with": "src/environments/environment.production.ts"
                                }
                            ],
                            "baseHref": "/aspnetcoreangular/",
                            "buildOptimizer": true,
                            "extractCss": true,
                            "extractLicenses": true,
                            "namedChunks": false,
                            "optimization": true,
                            "outputHashing": "all",
                            "sourceMap": false,
                            "vendorChunk": false
                        },
                        "staging": {
                            "fileReplacements": [
                                {
                                    "replace": "src/environments/environment.ts",
                                    "with": "src/environments/environment.staging.ts"
                                }
                            ],
                            "baseHref": "/aspnetcoreangular/",
                            "buildOptimizer": true,
                            "extractCss": true,
                            "extractLicenses": true,
                            "namedChunks": false,
                            "optimization": true,
                            "outputHashing": "all",
                            "sourceMap": false,
                            "vendorChunk": false
                        }
                    }
                },
                "serve": {
                    "builder": "@angular-devkit/build-angular:dev-server",
                    "options": { "browserTarget": "project:build" }
                }
            },
            "cli": {
                "warnings": {
                    "typescriptMismatch": false,
                    "versionMismatch": false
                }
            },
            "prefix": "app",
            "projectType": "application",
            "root": "",
            "sourceRoot": "src"
        }
    }
}

【问题讨论】:

标签: json visual-studio package.json


【解决方案1】:

https://developercommunity.visualstudio.com/t/support-json-schema-draft-06-draft-07/796216

VS 仍然不支持 json-schemes 的草案 7 并且停留在草案 4-5。因此发出警告。

这是一个误报。

编辑

Mike(见下文)建议解决方法。请务必检查一下,如果可行,请给 Mike 投票(这样他就会成为列出的第一个答案)。

【讨论】:

  • 有一个简单的修复方法。请参阅下面的答案。
【解决方案2】:

在 Visual Studio 中,将文件顶部的 Schema 下拉菜单更改为: https://json.schemastore.org/global.json

参考:https://developercommunity.visualstudio.com/t/support-json-schema-draft-06-draft-07/796216

【讨论】:

  • 谢谢。我希望编辑对你有用。保重,祝你好运。
猜你喜欢
  • 2017-06-26
  • 1970-01-01
  • 2017-03-23
  • 1970-01-01
  • 1970-01-01
  • 2021-11-21
  • 2018-02-26
  • 2021-05-12
  • 1970-01-01
相关资源
最近更新 更多