谁能解释我的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"
}
}
}
答案 0 :(得分:17)
https://developercommunity.visualstudio.com/t/support-json-schema-draft-06-draft-07/796216
VS 仍然不支持 json-schemes 的草案 7,并且停留在草案 4-5。因此发出警告。
这是一个误报。
答案 1 :(得分:9)
在 Visual Studio 中,将文件顶部的架构下拉列表更改为: https://json.schemastore.org/global.json
参考:https://developercommunity.visualstudio.com/t/support-json-schema-draft-06-draft-07/796216
答案 2 :(得分:0)
我想这只是一个IDE问题。解析器/突出显示无法识别关于package.json文件的某些信息?