In yarn global add babel
the process of installing the package , the following error was reported:
error An unexpected error occurred: "EPERM: operation not permitted, unlink 'C:\\Users\\xxx\\AppData\\Local\\Yarn\\Data\\global\\node_modules\\.bin\\serve'".
solve
C:\\Users\\xxx\\AppData\\Local\\Yarn\\Data\\global\\node_modules\\.bin\\
The content in the directory serve
is occupied. After
thinking about it carefully, it is currently being used serve
in another project. After closing it, re-run it yarn global add babel
and it will be fine.
The reason for this problem is that when the package is installed, the previous .bin
file will be deleted and then regenerated. Because the file is occupied, the file cannot be deleted, so an error will be reported. You only need to close the corresponding occupied program.
When the package is installed, the previous .bin
files will be deleted and regenerated
. When the package is installed for the first time, babel
the creation time is as follows:
When the other package is installed for the second time, babel
the creation time is as follows: It
can be seen that the .bin
folder is created when the package is installed for the second time. The following has babel
been recreated.
In addition,
if you open the .bin
folder while installing the package, you can see .bin
that the folder will be deleted at the end of the package , and then regenerate