【问题标题】:Resolve `prop-types` in `.cache` after installing new plugin in Gatsby在 Gatsby 中安装新插件后解决 .cache 中的 `prop-types`
【发布时间】:2023-04-11 01:48:01
【问题描述】:

我是 Gatsby 的新手,只是按照它的教程进行操作。每当我安装新插件时,只需在教程页面中说gatsby-source-filesystemtypography,我就无法再次运行gatsby develop

错误清楚地说明了自己:

Module not found: Error: Can't resolve 'prop-types' in '/Users/comp-name/hello-gatsby/.cache' resolve 'prop-types' in '/Users/comp-name/hello-gatsby/.cache'

我能做的唯一解决方案是删除node_modules 并重新安装所有内容,然后当我尝试安装另一个插件时。这个循环发生了,我觉得很烦人。

有人对此有解决方案吗?

【问题讨论】:

    标签: javascript reactjs npm yarnpkg gatsby


    【解决方案1】:

    只要有issues relating to gatsby's cache,您就可以删除.cache 文件夹,或尝试执行相同操作的gatsby clean 命令。

    但是,粗略的 google 搜索显示其他人在https://github.com/gatsbyjs/gatsby/issues/11375 遇到了类似的问题,他们通过更新到最新版本的npm 并重新安装节点包解决了这个问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-03-16
      • 2020-09-04
      • 2021-10-15
      • 2020-08-13
      • 2021-08-29
      • 2017-11-11
      相关资源
      最近更新 更多