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)
这些问题是不言自明的:
\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\nRun Code Online (Sandbox Code Playgroud)\n等等...
\n正如您在他们的存储库中看到的,您必须使用yarn而不是npm,因为依赖项是使用yarn.lock文件锁定的。
因此,删除您node_modules的cache文件夹并运行yarn install(您可能需要先安装它)。
| 归档时间: |
|
| 查看次数: |
7957 次 |
| 最近记录: |