我所有的. json 文件都存在从 schemastore.azurewebsites.net 加载参考/模式的问题

我工作在 VS 代码,并开始得到这个错误昨天。我的所有 json 文件都有这个错误,而不只是少数。如果我没记错的话昨天或者前天程序有更新。更新是否中断了什么或者重置了我忘记设置的设置?

在查找这个文件时,人们谈论的是下载模式并在本地使用它,但是我不希望这样做,而是想知道为什么会出现这种情况?

我在使用代理服务器,但据我所知,这并没有改变。我得到的正是这个错误。

问题加载引用“ https://schemastore.azurewebsites.net/schemas/json/package.json”: 无法从“ https://schemastore.azurewebsites.net/schemas/json/package.json”加载模式: 无法连接到 https://schemastore.azurewebsites.net/schemas/json/package.json。错误: 连接 ECONNREFUSED 168.62.224.13:443

153135 次浏览

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"
}
]

Open User settings of visual studio code through the command palette:

  1. Press F1
  2. Type user settings.
  3. Select Preferences:Open User Settings from drop down
  4. Put below code and modify accordingly
"http.proxy": "http://username:password@hostname:port/",
"http.proxyAuthorization": null,
"http.proxyStrictSSL": true

enter image description here

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

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.

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"

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.

Just close your VsCode Editor and open it again. That should fix the error.

If you still want the proxy support to work, just disable the proxyStrictSSL. Don't need to adjust other settings.

I just turned off checkbox schema download and error gone.

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

I`ve just delete this setting 😃

"http.proxy": "http://.......",

for me turns out that the problem was due to terminal.integrated.shell.windows being deprecated in VSCode. these are the steps i followed to fix it :

  • Open command palette (CTRL + Shift + P)
  • Search "Preferences: Open "User Settings" (the JSON file)"
  • find this field => terminal.integrated.shell.windows delete it and type this instead inside of "terminal.integrated.profiles.windows":
  "PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell"
},
"Command Prompt": {
"path": [
"${env:windir}\\Sysnative\\cmd.exe",
"${env:windir}\\System32\\cmd.exe"
],
"args": [],
"icon": "terminal-cmd"
},
"Git Bash": {
"source": "Git Bash"
}
},```


if you want to disable PowerShell, just set its value to null

I tried every setting - the only one which works is adding this to settings.json:

  "json.schemas": [
{
"fileMatch": [
"/package.json"
],
"url": "https://json.schemastore.org/package",
"schema": true
},
]
}

Note, using the HTTP URL doesn't work - it just ignores the URL.

Add this to your setting.json. Your problem will be solved! Plus this works for me.

"json.schemas": [
{
"fileMatch": ["/package.json"],
"url": "https://json.schemastore.org/package",
"schema": true
}
]

For me this works the Azure Storage Emulator stopped working ;-(

To start the Azure Storage Emulator:

Select the Start button or press the Windows key.
Begin typing Azure Storage Emulator.
Select the emulator from the list of displayed applications.

https://learn.microsoft.com/en-us/azure/storage/common/storage-use-emulator

just do the 3

in CMD

AzureStorageEmulator.exe init
AzureStorageEmulator.exe start
AzureStorageEmulator.exe status

BAM all worked

I solved this issue by turning off proxy support in VS Code.

Open Settings and search for proxy support at the top. The only option shown should then be the one you want to switch from Override (which is the default) to off:

PS: You can also locate settings by pressing F1 and entering user settings.

enter image description here

It's issue of opening the vs code using command line or any type of terminal

for avoid this issue.

Just restart the vs code or close the vs code and open again