Installation and configuration of yarn and reasons why the yarn command is invalid

Download and install

1. Install
yarn official website address on the official website

2. Use the npm command to install.
Before this, you must have installed node and npm (node ​​comes with npm), NodeJS installation and environment configuration.

/*全局安装yarn*/
 npm install -g yarn

Configuration

1. Environment variables
The principle of configuring environment variables is actually very simple, that is, add the file directory you installed to the Path system variable, so that these files can be found during execution. So just add the following path (installation path) to Path. Just select the bin directory.
Insert image description here
Insert image description here

Reasons why yarn command is invalid

1. The directory selection is wrong, causing the configured path to be invalid.

2. The yarn installation path contains Chinese characters (all must be in English)

Guess you like

Origin blog.csdn.net/qq_45331969/article/details/123561896