Error executing Yarn start/ npm start command

Asked

Viewed 2,785 times

-3

As soon as I run the create-React-app command and create the project. at the end when I run the "Yarn start" command. follows the following error:

yarn run v1.22.4
warning package.json: No license field
error Command "start" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I’ve tried several things like deleting the node_modules folder, deleting Yarn.lock, deleting package.json, uninstalling and installing Node again. I don’t know what happened, because a day ago I was running the remote normally.

  • Try to rotate the command yarn in the project folder (just file Yarn, then the full command)

  • Since it is a comment on my answer, do not create a new answer to the question, comment in my reply that you have already done so and yet it did not work. Take advantage and edit your question with more information and even add package.json, since the error message points to it.

  • I deleted the npm/Yarn folders from the machine and when I ran the create-React-app command it worked! I think there was some problem with those folders. As soon as I created a new React application, a new npm folder was installed on the machine and since then, I have had no problems. I appreciate all the suggestions! Thank you very much!

  • Hello! It may sound silly, but I was having this same problem and all I did was close the program (vscode), and reopened. I made sure I was inside the correct project folder (web) and did the process again. It worked. In my case it was just lack of attention. I hope your problem is as simple as mine. Abraco!

  • I had the same error, tried a few ways , but solved when I restarted Vscode.

1 answer

3

In such cases, try to include the executed step-by-step in your question. From the description of the problem, the most likely is that you created the project and did not enter in the folder of his.

Following the React documentation:

yarn create react-app my-app
cd my-app
yarn start

Browser other questions tagged

You are not signed in. Login or sign up in order to post.