gatsby_Gatsby,修复“找不到模块gatsby-cli / lib / reporter”错误

gatsby

I created a site using Gatsby and I ran gatsby develop to start a local server.

我使用Gatsby创建了一个网站,并运行了gatsby develop来启动本地服务器。

But a weird error showed up, coloring with red my terminal:

但是出现了一个奇怪的错误,终端显示为红色:

Gatsby error

After a few searches across GitHub and StackOverflow (I found a lot of people with the same problem!) and this is what fixed the error.

在GitHub和StackOverflow上进行了几次搜索之后(我发现很多人都遇到同样的问题!),这就是修复错误的原因。

First, I deleted node_modules:

首先,我删除了node_modules

rm -rf node_modules

then I used yarn instead of npm install:

然后我用yarn代替了npm install

yarn

This installed all the packages again.

这将再次安装所有软件包。

Finally I ran gatsby develop and it worked.

最终,我运行了gatsby develop ,并且运行正常。

Not sure what the cause problem is/was, but I tried again running npm install instead of yarn and it didn’t work.

不知道是什么原因造成的,或者是,但是我再次尝试运行npm install而不是yarn ,它没有用。

翻译自: https://flaviocopes.com/gatsby-fix-lib-reporter-error/

gatsby

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值