yarn add global @tarojs/cli
The installation is completed, but the taro command shows that there is no such command. Just use NPM to install. Why?
Change the order of the command parameters. Global comes first and add comes second
//这实际还是把cli安装在局部环境
yarn add global @tarojs/cli
//这样才是安装到全局环境
yarn global add @tarojs/cli
Taro is locally installed in the node where the command is executed_ The modules directory and the bin directory are not configured to the environment variable% path%. Naturally, they cannot be used through taro. If yarn is installed as a binary installation package, the global path should be configured to the environment variable% path% by default. If taro is not found, the environment variable is missing. By default, yarn will place the taro command in the / C / users / user name / appdata / local / yarn / bin / directory, so you need to configure this path to the environment variable% path% '/ / query the yarn global bin path yarn config Current @ findstr global folder with the following command`