简体   繁体   English

安装react时如何解决“找不到项目”错误

[英]How can i solve "No project found" error when installing react

I am new to react and i am taking my first course on openclassrooms on react.我是反应的新手,我正在参加关于反应的开放课堂的第一门课程。 The instructor is using the command yarn global add create-react-app讲师正在使用命令yarn global add create-react-app
to setup but when i run the commdand i get the error below设置但是当我运行命令时,我收到以下错误

Usage Error: No project found in /E:/Web Dev/React/react-project

i have tried to use the command below that is provided in the react documentation but i stil get the same error我曾尝试使用反应文档中提供的以下命令,但我仍然遇到相同的错误

yarn create react-app my-app

How can i solve the problem i have looked up on the react documentation but still cannot find the solution.我如何解决我在 React 文档中查找但仍然找不到解决方案的问题。

I experienced the same issue and solved it as follows:我遇到了同样的问题并解决了以下问题:

  1. Uninstall yarn from npm using npm uninstall -g yarn使用npm uninstall -g yarnnpm uninstall -g yarn
  2. Install Yarn from Installation - Yarn Classic安装安装 Yarn - Yarn Classic
  3. Restart PowerShell / CMD重启 PowerShell / CMD

Before performing the above steps yarn --version printed 2.0.0-rc.27 on my machine.在执行上述步骤之前, yarn --version在我的机器上打印了2.0.0-rc.27 Now it prints 1.22.4 .现在它打印1.22.4

Having Yarn 2.x globally installed is discouraged accourding to Installation - Yarn 2.x .根据Installation - Yarn 2.x 的规定,不鼓励全局安装 Yarn 2.x。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 请问我该如何解决VS Code React Project上的这个错误 - Please how can I solve this error on VS Code React Project 如何在尝试 npm 时解决错误我在 React 项目中的模块 - How to solve an error while trying to npm i the modules in a React project 得到错误 Module not found: Error: Can't resolve '../components/***' when webpack build, 我该如何解决这个问题? - got error Module not found: Error: Can't resolve '../components/***' when webpack build,how can I solve this problem? 我该如何解决这个错误? “在'./App'中找不到导出'默认'(导入为'App')(可能的导出:App)”(我使用反应) - How can I solve this error? "export 'default' (imported as 'App') was not found in './App' (possible exports: App)" (im using react) 我如何解决“函数作为 React 子节点无效”的问题。 错误? - How can I solve 'Functions are not valid as a React child.' error? 如何解决反应中的“上下文提供者不是路由组件”错误? - How can I solve ' context provider is not a route component ' error in react? 如何解决 React 应用程序初始化时显示的此错误? - How do I solve this error that shows when react app initializes? 我如何解决 React useEffect 清理错误问题 - How can i solve React useEffect clean up error issue React 错误:如何解决未定义的错误? - React Error: How can i solve udefined errors? 当我将 React App 转换为 ES6 时,出现 Module Not found 错误,我该如何解决? - When I convert a React App to ES6, I got Module Not found error, how can I fix it?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM