Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

turbo-ignore throw an error if there is a symlink in the packages folder #8625

Open
1 task done
fveauvy opened this issue Jun 28, 2024 · 1 comment
Open
1 task done
Labels
kind: bug Something isn't working owned-by: turborepo

Comments

@fveauvy
Copy link

fveauvy commented Jun 28, 2024

Verify canary release

  • I verified that the issue exists in the latest Turborepo canary release.

Link to code that reproduces this issue

https://github.com/fveauvy/turbo-ignore-issue

What package manager are you using / does the bug impact?

Yarn v1

What operating system are you using?

Mac

Which canary version will you have in your reproduction?

[email protected]

Describe the Bug

Context

In our project, we have a knowledge root folder where we centralize all project-related documentation. We use symbolic links to reference this documentation in relevant places within the repository.

Example structure:

./
├── apps/
│  ├── apps-a/
│  ├── apps-b/
│  └── README.md -> ../knowledge/apps_README.md # Symlink
├── knowledge/
│  └── apps_README.md # the doc we want to display in `apps/` folder.
├── package.json
├── packages/
│  ├── pkg-a/
│  ├── pkg-b/
│  └── tooling-config/
├── README.md
├── turbo.json
└── yarn.lock

This method enhances discoverability for newcomers and simplifies documentation maintenance by centralizing all knowledge in one place and distributing it via symlinks to relevant locations.

The issue

Due to our structure (symlinks within one of the workspace folders), we encounter an error when using turbo-ignore.

The command npx turbo-ignore <app-name> fails with the following error:

npm error code ENOTDIR
npm error syscall open
npm error path /Users//my-turborepo/apps/README.md/package.json
npm error errno -20
npm error ENOTDIR: not a directory, open '/Users/
/my-turborepo/apps/README.md/package.json'

It appears that turbo-ignore mistakenly identifies the README.md symlink as a directory and attempts to locate a package.json file within it.

Expected Behavior

npx turbo-ignore <app-name> should not throw an error when encountering a symlink to a file within a Yarn workspace folder.

To Reproduce

  1. git clone [email protected]:fveauvy/turbo-ignore-issue.git
  2. cd turbo-ignore-issue && yarn install
  3. npx turbo-ignore app-b

Additional context

No response

@fveauvy fveauvy added kind: bug Something isn't working needs: triage New issues get this label. Remove it after triage owned-by: turborepo labels Jun 28, 2024
@chris-olszewski
Copy link
Contributor

This is not turbo-ignore, but NPM itself. It can be reproduced by using any package not installed locally via npx:

[0 olszewski@chriss-mbp] /tmp/turbo-ignore-issue $ npx is-even
npm ERR! code ENOTDIR
npm ERR! syscall open
npm ERR! path /private/tmp/turbo-ignore-issue/apps/README.md/package.json
npm ERR! errno -20
npm ERR! ENOTDIR: not a directory, open '/private/tmp/turbo-ignore-issue/apps/README.md/package.json'

npm ERR! A complete log of this run can be found in: /Users/olszewski/.npm/_logs/2024-07-01T19_57_40_578Z-debug-0.log

I'm unsure of where in the NPM stack this path is getting opened.

@chris-olszewski chris-olszewski removed the needs: triage New issues get this label. Remove it after triage label Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working owned-by: turborepo
Projects
None yet
Development

No branches or pull requests

2 participants