All of my .json files have problems loading reference/schema from schemastore.azurewebsites.net

后端 未结 11 1368
春和景丽
春和景丽 2021-02-05 00:06

I\'m working in VS Code and started getting this error yesterday. All of my json files have this error, not just a few. If I remember right there was an update to the program

相关标签:
11条回答
  • 2021-02-05 00:18

    please follow the step below to solve this problem:

    1. Open the folder where package.json file present
    2. Type npm install from cmd
    3. restart VS code or any IDE that you use.
    0 讨论(0)
  • 2021-02-05 00:22

    I was facing following issue with Angular 6:

    Problems loading reference 'https://schemastore.azurewebsites.net/schemas/json/package.json': Unable to load schema from 'https://schemastore.azurewebsites.net/schemas/json/package.json': Unable to connect to https://schemastore.azurewebsites.net/schemas/json/package.json. Error: unable to get local issuer certificate

    I added following properties at the end of the User Settings File and worked for me:

    "http.proxy": "",
    "http.proxyAuthorization": null,
    "http.proxyStrictSSL": false
    
    0 讨论(0)
  • 2021-02-05 00:25

    I'm behind my company's proxy which I don't know the details because it's everything automatic, and this problem have bug me for some time.

    I'm not sure whether this is an universal solution but according to this issue, the http.proxySupport setting is defaulting to "override". I turn this setting off and the errors disappeared.

        "http.proxySupport": "off"
    
    0 讨论(0)
  • 2021-02-05 00:26

    Well i didnt like the idea to set "http.proxyStrictSSL": false, so i started searching, and i found this Issue on SchemaStore site from azure. After seeing this i concluded that my proxy was getting some problem with the certificate and authentication. What i did was change all "https" to "http" in the following session of package.json file(Mine was on this path: C:\Program Files\Microsoft VS Code\resources\app\extensions\typescript-basics\package.json).

    "jsonValidation": [
      {
        "fileMatch": "tsconfig.json",
        "url": "http://schemastore.azurewebsites.net/schemas/json/tsconfig.json"
      },
      {
        "fileMatch": "tsconfig.json",
        "url": "./schemas/tsconfig.schema.json"
      },
      {
        "fileMatch": "tsconfig.*.json",
        "url": "http://schemastore.azurewebsites.net/schemas/json/tsconfig.json"
      },
      {
        "fileMatch": "tsconfig.*.json",
        "url": "./schemas/tsconfig.schema.json"
      },
      {
        "fileMatch": "typings.json",
        "url": "http://schemastore.azurewebsites.net/schemas/json/typings.json"
      }
    ]
    
    0 讨论(0)
  • 2021-02-05 00:26

    After banging my head against this for longer than I care to admit, I just needed to add the proxyAuthorization value for my Base64 encoded credentials, and did not need the proxy or proxyStrictSSL values.

    I already had my proxy correctly configured in my environment variables. It only has the domain and port, not my credentials, ex. "HTTP_PROXY" "http://example.com:port/".

    I used this C# code in LINQPad to get the proxyAuthorization value from my credentials:

    var pw = "user@example.com:password";
    var base64Encoded = Convert.ToBase64String(Encoding.UTF8.GetBytes(pw));
    base64Encoded.Dump();
    

    This is what I have in my user settings.json, using the encoded string from the above code dump.

    "http.proxyAuthorization": "BASE64_ENCODED_VALUE"
    

    Note: I believe that if I didn't need the full username with email address in the credentials for our proxy to let me out, I could have used an above solution. But since I did, this was the only way I could get it to work.

    0 讨论(0)
  • 2021-02-05 00:31

    I just turned off checkbox schema download and error gone.

    Press F1 and follow open user settings/user/extentions/JSON

    0 讨论(0)
提交回复
热议问题