React -Parcel-构建失败。错误:无法解析模块“自行发布/包裹 - swc.darwin-x64.node”。

发布于 2025-01-24 09:36:26 字数 418 浏览 4 评论 0原文

这是一个尴尬的问题。 我前一段时间用使用包裹构建的React进行了该项目。 现在,几个月后,我试图启动该项目,这给了我一些错误。 我再次从存储库下载该项目,并且包裹开始再次建立了几个小时,并且再次出现同样的错误。我再次从存储库下载了该项目,然后开始再次运行,但是没有项目中的任何更改……它开始再次给出相同的构建错误。 你们中有些人遇到了这个问题吗?

包裹构建失败

package.json

谢谢!

It's coming across to me one awkward issue.
I made this project a while ago with React using Parcel to build.
Now after a couple of months I tried to start the project and it gave me some errors building.
I download again the project from the repository and the parcel started to build again for a couple of hours and the same error came up again. Once again, I download the project from the repository and it start to run again, but without any change made in the project...it started to give again the same Build Error.
Did some of you had this issue?

Parcel Build failing

Package.json

Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

何以心动 2025-01-31 09:36:26

(此答案是对新错误

当 您将项目升级到Parcel 2.5.0时)运行包裹索引。如果全局版本仍然2.0.0-rc0(2021年8月发布),您的发现是我所获得的错误,并尝试使用最新版本的@parcel/config -default(安装在项目中),因为“ nofollow noreferrer”> Compresser插件支持于2021年9月添加。

从原始屏幕截图中,您似乎已经在package.json.json ...

{
   "scripts": {
       "start": "parcel index.html"
   }
}

通过运行npm npm运行start start - 这将使用那里安装的包裹(2.5.0)版本。

(This answer is in response to the New Error you get after upgrading the project to parcel 2.5.0)

When you run parcel index.html, you'll be invoking the version of parcel that's installed globally, not the one locally specified by package.json. The error your getting is what I'd expect if the global version was still 2.0.0-rc0 (released August 2021) was run and tried to use the latest version of @parcel/config-default (installed in your project), because compressor plugin support was added in September 2021.

From the original screenshots, it looks like you already have a "start" command in your package.json...

{
   "scripts": {
       "start": "parcel index.html"
   }
}

Invoke it by running npm run start - this will use the version of parcel (2.5.0) installed there.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文