错误 #98123 WEBPACK 在“gatsbydevelop”上生成开发 JavaScript 包失败

xdg*_*Ace 8 javascript node.js npm webpack gatsby

我运行以下命令来创建一个新的 gatsby 入门博客:

gatsby new blog https://github.com/alxshelepenok/gatsby-starter-lumen

cd blog

gatsby develop

但在期间gatsby develop,我收到了很多错误,名为“ERROR #98123 WEBPACK生成 开发 JavaScript 包失败”。

我已经尝试了很长时间,一次又一次地删除并安装了存储库,也删除了node_modules,package-lock.json然后又npm install再次出现相同的错误。帮帮我!


有关详细信息,这是我收到的错误的完整列表(有点长):



套餐:

 node v10.19.0
 npm 6.14.4
 OS: Ubunut 20.04LTS
Run Code Online (Sandbox Code Playgroud)
    "gatsby": "^2.31.1",
    "gatsby-cli": "^2.18.0",
    "gatsby-link": "^2.10.0",
    "gatsby-plugin-catch-links": "^2.9.0",
    "gatsby-plugin-feed": "^2.12.0",
    "gatsby-plugin-flow": "^1.9.0",
    "gatsby-plugin-google-gtag": "^2.7.0",
    "gatsby-plugin-manifest": "^2.11.0",
    "gatsby-plugin-netlify": "^2.10.0",
    "gatsby-plugin-netlify-cms": "^4.9.0",
    "gatsby-plugin-offline": "^3.9.0",
    "gatsby-plugin-optimize-svgs": "^1.0.5",
    "gatsby-plugin-react-helmet": "^3.9.0",
    "gatsby-plugin-sass": "^3.1.0",
    "gatsby-plugin-sharp": "^2.13.1",
    "gatsby-plugin-sitemap": "^2.11.0",
    "gatsby-remark-autolink-headers": "^2.10.0",
    "gatsby-remark-copy-linked-files": "^2.9.0",
    "gatsby-remark-external-links": "0.0.4",
    "gatsby-remark-images": "^3.10.0",
    "gatsby-remark-katex": "^3.9.0",
    "gatsby-remark-prismjs": "^3.12.0",
    "gatsby-remark-relative-images": "^2.0.2",
    "gatsby-remark-responsive-iframe": "^2.10.0",
    "gatsby-remark-smartypants": "^2.9.0",
    "gatsby-source-filesystem": "^2.10.0",
    "gatsby-transformer-remark": "^2.15.0",
    "gatsby-transformer-sharp": "^2.11.0",
    ```


Run Code Online (Sandbox Code Playgroud)

B-M*_*ney 6

我的问题是类似的。我安装了一个新的 Gatsby 站点,没有插件,当进行简单的 HTML 更改,然后预览 DEVELOP 站点并刷新时,每次我都会看到这些充其量是神秘的 webpack 错误。

这解决了一切:

  1. 停止服务器 ( ctrl+ C)
  2. 跑步gatsby clean
  3. 删除node_modules文件夹
  4. 删除package-lock.json文件
  5. 如果尚未安装 Yarn,请安装 ( npm install -g yarn)
  6. 运行纱线安装(yarn install)
  7. 重新启动服务器并测试 ( gatsby develop)

这要归功于费兰。


Fer*_*reu 4

这些问题是不言自明的:

\n
/home/myPC/Documents/blog/src/components/Feed/Feed.js\n  4:13  error  Parsing error: Unexpected token {\n\xe2\x9c\x96 1 problem (1 error, 0 warnings)\n\nFile: src/components/Feed/Feed.js\n\n/home/myPC/Documents/blog/src/components/Icon/Icon.js\n  5:6  error  Parsing error: Unexpected token Props\n\n\xe2\x9c\x96 1 problem (1 error, 0 warnings)\n\nFile: src/components/Icon/Icon.js\n
Run Code Online (Sandbox Code Playgroud)\n

等等...

\n

正如您在他们的存储库中看到的,您必须使用yarn而不是npm,因为依赖项是使用yarn.lock文件锁定的。

\n

因此,删除您node_modules的cache文件夹并运行yarn install(您可能需要先安装它)。

\n