简体   繁体   English

运行gatsby development时发现预设的“反应”,从而导致gats错误

[英]error with gatsby finding preset “react” when running gatsby develop

I'm trying to get gatsby to make a new project and hopefully use it to power a new blog. 我正在尝试让盖茨比(Gatsby)制作一个新项目,并希望使用它来推动新博客的发展。 So, I downloaded the cli, created a new project, cd into that folder, and tried to run 'gatsby develop', which results in an error I can't find the answer to. 因此,我下载了cli,创建了一个新项目,将cd放入该文件夹,并尝试运行“ gatsby development”,这导致我找不到答案的错误。 It says it can't find preset "react" in my root directory. 它说它在我的根目录中找不到预设的“反应”。 Why is it looking for react in my root directory when the project folder isn't located there? 当项目文件夹不在根目录中时,为什么要在我的根目录中寻找响应?

Here's what my terminal looks like: 这是我的终端的样子:

 C:\Users\Kevin Murphy\Desktop\Projects\web-dev-blog  (gatsby-starter-default@1.0.0)
λ gatsby develop
success delete html and css files from previous builds — 0.023 s
success open and validate gatsby-config.js — 0.005 s
success copy gatsby files — 0.022 s
success onPreBootstrap — 0.034 s
success source and transform nodes — 0.018 s
success building schema — 0.111 s
success createLayouts — 0.038 s
success createPages — 0.001 s
success createPagesStatefully — 0.035 s
success onPreExtractQueries — 0.000 s
success update schema — 0.042 s
success extract queries from components — 0.064 s
success run graphql queries — 0.027 s
success write out page data — 0.008 s
success write out redirect data — 0.001 s
success onPostBootstrap — 0.001 s

info bootstrap finished - 4.074 s

error There was an error compiling the html.js component for the development server.

See our docs page on debugging HTML builds for help 


  Error: Module build failed: Error: Couldn't find preset "react" relative to directory "C:\\Users\\Kevi
  n Murphy"

  - option-manager.js:293
    [web-dev-blog]/[babel-core]/lib/transformation/file/options/option-manager.js:293:19

  - Array.map

  - option-manager.js:275 OptionManager.resolvePresets
    [web-dev-blog]/[babel-core]/lib/transformation/file/options/option-manager.js:275:20

  - option-manager.js:264 OptionManager.mergePresets
    [web-dev-blog]/[babel-core]/lib/transformation/file/options/option-manager.js:264:10

  - option-manager.js:249 OptionManager.mergeOptions
    [web-dev-blog]/[babel-core]/lib/transformation/file/options/option-manager.js:249:14

  - option-manager.js:368 OptionManager.init
    [web-dev-blog]/[babel-core]/lib/transformation/file/options/option-manager.js:368:12

  - index.js:212 File.initOptions
    [web-dev-blog]/[babel-core]/lib/transformation/file/index.js:212:65

  - index.js:135 new File
    [web-dev-blog]/[babel-core]/lib/transformation/file/index.js:135:24

  - pipeline.js:46 Pipeline.transform
    [web-dev-blog]/[babel-core]/lib/transformation/pipeline.js:46:16

  - index.js:46 transpile
    [web-dev-blog]/[babel-loader]/lib/index.js:46:20

  - fs-cache.js:79
    [web-dev-blog]/[babel-loader]/lib/fs-cache.js:79:18

  - fs-cache.js:15 ReadFileContext.callback
    [web-dev-blog]/[babel-loader]/lib/fs-cache.js:15:14

Maybe in one of your components or pages, you're importing react from /react instead of just react ? 也许在您的组件或页面之一中,您是从/react导入/react而不是react It should look like import React from 'react' . 它看起来应该像import React from 'react'一样。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当我为 gatsby-starter-gcn 运行 gatsby develop 时,如何修复错误 #10123? - How to fix Error #10123 when I run gatsby develop for gatsby-starter-gcn? 运行Gatsby开发命令,但gatsby构建出错 - Gatsby develop command runs but gatsby build gives error gatsby 开发后接收错误 #98123 - Receiving ERROR #98123 after gatsby develop 盖茨比未开发任何注册为“ \\”的解析器 - Gatsby develop no parsers registered for: “\” Gatsby 在 GitHub Actions CI 中运行时抛出 SIGSEV 错误 - Gatsby throws SIGSEV error when running in GitHub Actions CI 在不重新运行“gatsby-develop”的情况下将内容更改同步到 localhost gatsby build - Syncing contentful changes to localhost gatsby build without re-running `gatsby-develop` 在 Zeit 上使用 gatsby-source-buttercms 部署 gatsby 应用程序时出错 - Error when deploying the gatsby app with gatsby-source-buttercms on Zeit Gatsby - 'gatsby develop' 命令没有出错。 没有错误或信息 - Gatsby - 'gatsby develop' command struck without error. GIves no error or info 如何修复 Gatsby 开发错误:找不到模块“gatsby-cli/lib/reporter”? - How To Fix Gatsby Develop Error: Cannot find module 'gatsby-cli/lib/reporter'? Gatsby 开发失败:错误:找不到模块“gatsby-cli/lib/reporter” - Gatsby Develop failing : Error: Cannot find module 'gatsby-cli/lib/reporter'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM