我运行了以下命令来创建一个新的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 "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",
```发布于 2021-01-30 18:18:27
这些问题是不言而喻的:
/home/myPC/Documents/blog/src/components/Feed/Feed.js
4:13 error Parsing error: Unexpected token {
✖ 1 problem (1 error, 0 warnings)
File: src/components/Feed/Feed.js
/home/myPC/Documents/blog/src/components/Icon/Icon.js
5:6 error Parsing error: Unexpected token Props
✖ 1 problem (1 error, 0 warnings)
File: src/components/Icon/Icon.js等等..。
正如您在储存库中所看到的,您必须使用纱线而不是npm,因为依赖项使用yarn.lock文件锁定。
因此,删除node_modules、cache文件夹并运行yarn install(您可能需要在此之前安装它)。
发布于 2021-10-09 09:13:28
我得到这个错误是因为我的窗口用户名中有一个撇号和/或空格。切换到另一个用户解决了这个问题。如果您的错误包括以下内容,这也可能是您的问题。
./node_modules/@pmmmwh/react-refresh-webpack-plugin/loader/index.js发布于 2022-11-29 06:16:13
我刚刚删除了节点模块、缓存文件夹和公用文件夹。在那之后我就跑
npm i
gatsby clean && gatsby build从那以后我的问题就解决了。
https://stackoverflow.com/questions/65970921
复制相似问题