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

[bug]: shadcn add EACCES: permission denied, scandir #4813

Open
2 tasks done
sndnr opened this issue Sep 11, 2024 · 5 comments
Open
2 tasks done

[bug]: shadcn add EACCES: permission denied, scandir #4813

sndnr opened this issue Sep 11, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@sndnr
Copy link

sndnr commented Sep 11, 2024

Describe the bug

Having a 'data' docker/podman folder at the same level of components,

app/
data/
components/ui
tailwind.config.ts
tsconfig.json
components.json
[...]

Gives a :

EACCES: permission denied, scandir '${SOMEPATH}/next-project/data'

Even if i runshadcn add button -p ./components/ui

This also fails on a shadcn init, having the data folder previously created/used

Affected component/components

CLI add/init

How to reproduce

shadcn init
EACCES: permission denied, scandir ...SOMEPATH

shadcn add button -p ./components/ui
✔ Checking registry.
✔ Installing dependencies.
⠋ Updating files.
Something went wrong. Please check the error below for more details.
If the problem persists, please open an issue on GitHub.

EACCES: permission denied, scandir ...SOMEPATH

Codesandbox/StackBlitz link

No response

Logs

No response

System Info

Selinux

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@sndnr sndnr added the bug Something isn't working label Sep 11, 2024
@JoaquinRodriguezc
Copy link

same issue here

@WildEgo
Copy link

WildEgo commented Sep 21, 2024

Funnily enough I too am having that issue

@kimanikevin254
Copy link

This error seems to occur if you have a folder in your project directory that the shadcn CLI does not have enough permissions to access. In my project folder, I had a Docker persistence volume that the shadcn CLI could not access. I suggest adding an option for the Shadcn CLI to ignore specific directories, allowing users to list directories that the CLI should not scan.

@kimanikevin254
Copy link

This error seems to occur if you have a folder in your project directory that the shadcn CLI does not have enough permissions to access. In my project folder, I had a Docker persistence volume that the shadcn CLI could not access. I suggest adding an option for the Shadcn CLI to ignore specific directories, allowing users to list directories that the CLI should not scan.

In the meantime, you can modify the permissions of the directory with permission issues to allow read and write access for all users:

sudo chmod -R 755 /path/to/folder/with/restricted/permissions

@sndnr
Copy link
Author

sndnr commented Sep 24, 2024

The shadcn CLI init/scan must have nothing to do with folders other than ${PROJECT_PATH}/components/ui. If needed, the init/scan function only needs to init/scan the -p PATH used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants