安装纱线后,npx create-react-app不再工作(即使卸载纱线后,

发布于 2025-02-11 10:21:02 字数 379 浏览 2 评论 0 原文

一切正常,我什至更早地进行了。我要做的就是创建一个React应用程序。我使用了命令npx create-react-app,一切正常。

我决定尝试YARN而不是NPM,这使一切都无法正常工作。将头撞在墙上后,我决定卸载它,并且我得到的错误与安装纱线时完全相同。

它给了我这个在此处输入图像描述警告我正在使用NPM版本5.1.0,即使您可以在底部看到我拥有8.11.0版本。最重要的是,我得到了“ npm err!cb。应用不是一个函数”,我尝试在堆栈溢出上搜索它。那家伙对卸载node_modules说,但我很确定我已经将其删除了。

Everything was working perfect, I even had it going earlier. All I am trying to do is create a react app. I used the command npx create-react-app and everything worked.

I decided to try yarn instead of npm, that made everything not work. After bashing my head against the wall I decided to uninstall it and I get the exact same error as when I had yarn installed.

It's giving me thisenter image description here warning that I am using npm version 5.1.0 EVEN THOUGH you can see at the bottom that I have version 8.11.0. On top of that I get "npm ERR! cb.apply is not a function" I tried googling it on Stack Overflow. The guy says to uninstall node_modules but I am pretty sure I already have it removed.

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

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

发布评论

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

评论(2

墨离汐 2025-02-18 10:21:02

您很可能在节点/NPM路径中有一个配置错误,在大多数情况下,重新安装是解决问题的最快方法:https://javascript.plainenglish.io/the-best-way-to-reinstall-node-js-mac-linux- Windows-DF3212FDD2E

You most likely have a configuration error in your node/npm PATH, in most situations a reinstall is the quickest way to fix your problem: https://javascript.plainenglish.io/the-best-way-to-reinstall-node-js-mac-linux-windows-d5f3212fdd2e

私野 2025-02-18 10:21:02

您需要使用NPM或YARN卸载 create-react-app 模块,并使用 npm unstall -G create-react-app ,然后再次运行create react-app命令安装最新版本。

在官方网站此处,请参见有关此信息的更多信息。

You need to uninstall the create-react-app module with either npm or yarn with npm uninstall -g create-react-app then run the create react-app command again to install latest version.

See more about this on the official site here

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