Skip to content

[Bug] Yarn instal fails if node_modules is a docker volume or similar #4172

Closed
@ncjones

Description

@ncjones

This is the exact same issue as #1184.

When using nodeLinker: node-modules, during the link step, yarn will attempt to delete the entire node_modules directory, instead of only its contents. This causes problems with the common docker pattern of mounting node_modules as a volume, resulting in an error like the following:

➤ YN0000: ┌ Link step
➤ YN0001: │ Error: EBUSY: resource busy or locked, rmdir '/work/node_modules'
➤ YN0000: └ Completed
➤ YN0000: Failed with errors in 0s 98ms

To reproduce

git clone [email protected]:ncjones/yarn-nm-volume.git
cd yarn-nm-volume
docker compose run script yarn install

See ncjones/yarn-nm-volume.

Environment

System:
    OS: macOS

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions