It is clearly in accordance with the steps of umi’s official website to create a project why will report an error?
I scoured the Internet for solutions and came up with the following two solutions
The first, more common solution
Find the bin directory under node_global in the node installation directory (everyone’s computer may have a slightly different directory).
Right-click create-umi. CMD and edit the text as follows, removing the preceding ‘%~dp0\’ symbol
Do not create a project at this point. Otherwise, the file will be overwritten to its original form
You only need to create-umi. If “Not an internal or external command” is displayed, add the create-umi. CMD directory to the path of the environment variable
The second way
Run the YARN Global bin command to view the YARN directory
Use YARN Global dir to view the global directory
The original cause is that the YARN directory on my computer and the module installed are not in the same hard disk partition
Change the global installation location and cache location of YARN.
yarn config set global-folder "D:\yarnConfig\yarn_global"
yarn config set cache-folder "D:\yarnConfig\yarn_cache"
Copy the code
To create a UMI project, run YARN Create UMI again