我当时正在做一个项目,今天我看到一个关于 VScode 无法解析 package.json 架构的错误:
CSS 对 package.json 的贡献
加载引用“vscode://schemas/settings/configurationDefaults”时出现问题:无法从“vscode://schemas/settings/configurationDefaults”加载架构:无法打开 vscode://schemas/settings/configurationDefaults。详细信息:无法解析资源 vscode://schemas/settings/configurationDefaults 的文本模型内容。
它有点类似于文件:'package.json'严重性:'警告'消息:'加载引用时出现问题'':无法从''加载架构:无法连接到 但问题是我的错误与本地文件有关。我想知道为什么会发生这种情况以及如何“撤消”这种情况。一些答案围绕网络设置,而来自表单链接问题的答案建议手动将模式添加到设置中,但我不确定为什么我必须这样做,因为它之前工作正常。
我无法确定此错误出现之前的任何特定活动。关于可能的原因有什么想法吗?
所以我无意中发现了一些奇怪的东西,但不明白为什么会这样。
我在我的终端(iTerm 上是 ZSH)中创建了这个curl:
curl -I https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find\?text\=1%20TX%2077979\&f\=json
Run Code Online (Sandbox Code Playgroud)
响应是:
HTTP/2 200
date: Wed, 28 Oct 2020 17:31:12 GMT
content-type: application/json;charset=UTF-8
content-length: 374
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
server:
etag: dc0a3f17
x-esri-ftiles-cache-compress: true
cache-control: max-age=300
x-cached: MISS
vary: Origin,Accept-Encoding
strict-transport-security: max-age=31536000
Run Code Online (Sandbox Code Playgroud)
但是如果我在节点(v14.14.0)中运行与 exec child_process 相同的curl,如下所示:
const { exec } = require('child_process');
const url = 'https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find\?text\=1%20TX%2077979\&f\=json';
return exec(`curl -I ${url}`, (err, std) => {
console.log(std);
});
Run Code Online (Sandbox Code Playgroud)
响应如下所示:
HTTP/2 403
date: Wed, 28 Oct 2020 17:17:18 GMT
content-type: text/html;charset=utf-8
content-length: 680
x-content-type-options: nosniff
x-xss-protection: …
Run Code Online (Sandbox Code Playgroud)