![](/img/trans.png)
[英]Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find module './src/data'
[英]Gatsby - Error: Cannot find module '..\node_modules\gatsby\dist\utils\babel-loader.js'
运行gatsby develop
时,在gatsby new
之后使用教程中提供的配置 - https://www.gatsbyjs.com/docs/tutorial/part-1/ ,我收到此错误
模块构建失败(来自../../my-first-gatsby-sitenode_modules/gatsby/dist/utils/babel-loader.js):错误:找不到模块'..\my-first-gatsby-site\node_modules \gatsby\dist\utils\babel-loader.js'
我尝试过的解决方案:
node_modules/gatsby
中运行npm install
。如果您遇到错误并能够解决它,请提供帮助。 TIA。
在
node_modules/gatsby
中运行npm install
。
npm install
必须在项目的根目录中运行,而不是在node_modules
中。
删除 node_modules, package-lock => npm install / yarn.
您应该只选择 npm 或纱线,不能同时选择两者。
尝试以下操作:
npm install --save gatsby-cli
npm audit fix
(在项目的根目录中)。npm install
删除您的node_modules
并重新安装项目根目录中的依赖项
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.