创建反应不得按预期工作
我的系统中有以下设置,
%asdf shim-versions create-react-app
nodejs 12.16.3
% asdf current nodejs
nodejs 14.17.6 /Users/user/.tool-versions
但是当我运行npm以创建react-app时,如下所示,我尝试了以下输出,
% npm init react-app react-complete-guide
No preset version installed for command create-react-app
Please install a version by running one of the following:
asdf install nodejs 14.17.6
or add one of the following versions in your config file at /Users/user/.tool-versions
nodejs 12.16.3
我尝试了asdf reshim nodejs
我的设置中是否有问题?
I have the following setup in my system
%asdf shim-versions create-react-app
nodejs 12.16.3
% asdf current nodejs
nodejs 14.17.6 /Users/user/.tool-versions
But when I run npm to create react-app as follows get the following output
% npm init react-app react-complete-guide
No preset version installed for command create-react-app
Please install a version by running one of the following:
asdf install nodejs 14.17.6
or add one of the following versions in your config file at /Users/user/.tool-versions
nodejs 12.16.3
I have tried asdf reshim nodejs
Is there something wrong in my setup?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它是NPX create-react-app,而不是NPM创建反应应用。
It's npx create-react-app not npm create-react-app.
通过卸载旧版本的节点来解决此问题,这是绑定的创建反应应用程序。
通过进行
ASDF Shim-versions create-react-app
并卸载该节点版本的方式找到了如何发现。Solved this by uninstalling the old version of node which was what the create-react-app was tied to.
Found out how by doing
asdf shim-versions create-react-app
and uninstalling that node version.