错误:在插件“@sanity/vision”中未找到“sanity.json”文件。

huangapple go评论56阅读模式
英文:

Error: No "sanity.json" file found in plugin "@sanity/vision"

问题

在我的终端上运行“sanity init”时,在创建我的新的 Sanity 项目期间,我遇到了以下错误:

"Error: No 'sanity.json' file found in plugin '@sanity/vision'"

我已经尝试了一段时间来解决这个错误。我知道这与 Stackoverflow 上的此问题非常相似:https://stackoverflow.com/questions/65216022/error-no-sanity-json-file-found-in-plugin-sanity-base/75600464#75600464。错误消息甚至建议我查看 Sanity 上的这篇文档:https://www.sanity.io/help/missing-plugin-sanity-json。我已经尝试了所有的解决方案。我删除了我的 node_modules 文件夹并运行了 "sanity install" 命令,但没有成功。我尝试删除整个项目并创建一个新的项目,但仍然收到了这个错误。我尝试按照 Sanity 文档上的步骤去做(尽管我不理解他们想让我做什么),但依然没有成功。

以下是错误信息:

Error: No 'sanity.json' file found in plugin '@sanity/vision'
请帮助我理解和解决这个错误。谢谢。

英文:

As I was creating my new sanity project on my terminal while running "sanity init" during the process I received an error of:

"Error: No "sanity.json" file found in plugin "@sanity/vision""

I have been trying to solve this error for quite some time. I know it's very similar to this question on Stackoverflow of https://stackoverflow.com/questions/65216022/error-no-sanity-json-file-found-in-plugin-sanity-base/75600464#75600464. The error even suggest I look into this doc on Sanity https://www.sanity.io/help/missing-plugin-sanity-json. I have tried to do all the solutions . I deleted my node_modules folder and ran the "sanity install" command. It did not work. I tried deleting the whole project and create a new one and I still recieved the error. I tried following that sanity document on what I should do(Although I did not I understand what they wanted me to do) it still did not work.

Here is the error message:

Error: No "sanity.json" file found in plugin "@sanity/vision"
See https://docs.sanity.io/help/missing-plugin-sanity-json
    at handleManifestReadError (C:/Users/Bernadette Kotelo/Documents/Projects/Renanit's Art Portfolio/server/node_modules/@sanity/resolver/lib/readManifest.js:27:11)
    at C:/Users/Bernadette Kotelo/Documents/Projects/Renanit's Art Portfolio/server/node_modules/@sanity/resolver/lib/readManifest.js:56:60
    at async Promise.all (index 4)

Can anyone please help me understand and solve this error. Thank you

答案1

得分: 1

请确保你正在使用最新版本的Node,当我使用14v运行sanity init时出现了这个错误。尝试删除你的项目并使用Node v18.2.0或更高版本运行sanity init

英文:

Make sure you are using an up to date node version, I get this error when I ran sanity init using 14v, try deleting your project and run sanity init with node v18.2.0 or higher.

答案2

得分: 1

检查你的 sanity.json 文件,并删除下面的部分:

      "env": {
        "development": {
          "plugins": [
            "@sanity/vision"
          ]
        }
      },
英文:

Check your sanity.json file, and remove the section below:

  "env": {
    "development": {
      "plugins": [
        "@sanity/vision"
      ]
    }
  },

Sanity Vision is a plugin for Sanity Studio for testing GROQ queries but does not contain a sanity.json file in the plugin folder. Therefore, the env file can't find the @sanity/vision sanity.json.

huangapple
  • 本文由 发表于 2023年4月7日 03:34:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/75953166.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定