英文:
Why is yarn create react-app ./ not working
问题
PS C:\Users\Lewis Wachira\OneDrive\Desktop\Snack Shark Restaurant> cd client
PS C:\Users\Lewis Wachira\OneDrive\Desktop\Snack Shark Restaurant\client> yarn create react-app ./
成功安装 "create-react-app@5.0.1" 并创建可执行文件:create-react-app
'C:\Users\Lewis' 不被识别为内部或外部命令、可操作的程序或批处理文件。
错误,命令失败。
退出码:1
命令:C:\Users\Lewis Wachira\AppData\Local\Yarn\bin\create-react-app
参数:./
目录:C:\Users\Lewis Wachira\OneDrive\Desktop\Snack Shark Restaurant\client
输出:
信息:访问 https://yarnpkg.com/en/docs/cli/create 以获取有关此命令的文档。
我正在尝试在客户端文件夹中创建一个React应用程序,但出现错误。我运行的第一个命令是:
- cd client
然后我运行了
- yarn create react-app ./
英文:
PS C:\Users\Lewis Wachira\OneDrive\Desktop\Snack Shark Restaurant> cd clientPS C:\Users\Lewis Wachira\OneDrive\Desktop\Snack Shark Restaurant\client> yarn create react-app ./yarn create v1.22.19[1/4] Resolving packages...[2/4] Fetching packages...[3/4] Linking dependencies...[4/4] Building fresh packages...
success Installed "create-react-app@5.0.1" with binaries:create-react-app'C:\Users\Lewis' is not recognized as an internal or external command,operable program or batch file.error Command failed.Exit code: 1Command: C:\Users\Lewis Wachira\AppData\Local\Yarn\bin\create-react-appArguments: ./Directory: C:\Users\Lewis Wachira\OneDrive\Desktop\Snack Shark Restaurant\clientOutput:
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
I'm trying to create a react app in my client folder but I'm getting an error. The first command I ran was:
- cd client
Then I ran
- yarn create react-app ./`
答案1
得分: 1
我认为你应该运行以下命令:
yarn create react-app .
如果你不能使用yarn,我建议你尝试使用npx或npm,就像这样:
npx create-react-app .
或者
npm init react-app .
这里的```.```指定了初始化React应用的位置。
英文:
I think you should instead run
yarn create react-app .
If you can't do it with yarn, I'll suggest you to try with npx or npm, like this:
npx create-react-app .
or
npm init react-app .
That .
specifies the location for the react app to be initialized.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论