Home >Web Front-end >Front-end Q&A >What should I do if the react installation yarn keeps reporting that it is not an internal command?

What should I do if the react installation yarn keeps reporting that it is not an internal command?

藏色散人
藏色散人Original
2023-01-04 09:24:493066browse

The solution to the problem that react installation yarn keeps reporting that it is not an internal command: 1. Uninstall yarn through the command "pm uninstall yarn -g"; 2. Reinstall yarn using "npm install yarn"; 3. In the system variable path Add "C:\WINDOWS\system32\node_modules\yarn\bin"; 4. Re-open cmd and execute the "yarn -v" command.

What should I do if the react installation yarn keeps reporting that it is not an internal command?

The operating environment of this tutorial: Windows 10 system, react18.0.0 version, Dell G3 computer.

What should I do if the react installation yarn keeps reporting that it is not an internal command?

The problem occurred while installing yarn, 'yarn' is not recognized as an internal or external command, operable program or batch file.

Occurred during the previous installation

'yarn' is not an internal or external command, an operable program or batch file.

Then

  • Uninstall npm uninstall yarn -g

  • ##Install npm install yarn (it is best not to use other installation commands) Adding -g will have no effect)

  • Add environment variables: add C:\WINDOWS\system32\node_modules\yarn\bin

  • # to system variable path ##Reopen cmd and execute: yarn -v Check the version number
  • That’s it

What should I do if the react installation yarn keeps reporting that it is not an internal command?Recommended study:《

react video tutorial

The above is the detailed content of What should I do if the react installation yarn keeps reporting that it is not an internal command?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn