一切正常,我什至更早地进行了。我要做的就是创建一个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.
发布评论
评论(2)
您很可能在节点/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
您需要使用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 withnpm 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