Yarn add package loading error: operation not permitted, unlink …

In yarn global add babelthe 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 serveis occupied. After
thinking about it carefully, it is currently being used servein another project. After closing it, re-run it yarn global add babeland it will be fine.

The reason for this problem is that when the package is installed, the previous .binfile 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 .binfiles will be deleted and regenerated
. When the package is installed for the first time, babelthe creation time is as follows:

When the other package is installed for the second time, babelthe creation time is as follows: It

can be seen that the .binfolder is created when the package is installed for the second time. The following has babelbeen recreated.
In addition,
if you open the .binfolder while installing the package, you can see .binthat the folder will be deleted at the end of the package , and then regenerate


Read More:

Leave a Reply

Your email address will not be published. Required fields are marked *