Skip to content
Back

sh: vite: Permission denied

  • 0
  • 2
  • Self Hosted
  • Web
16 Jun, 2026, 04:00

When installing the vue starter template as site and then adding DaisyUI, i get the error sh: vite: Permission denied. I also got this issue (with a fresh template again) after installing PrimeVue, which apparently exceeds the upload size so i had to uninstall it again. After uninstalling and pushing, i get the error.

TL;DR
Issue with permissions denied in a deployment script due to incorrect handling of .gitignore file. User suggests loading .gitignore from the root repo directory. Proposed solution involves modifying the script to load .gitignore correctly from the root repo directory, ensuring proper deployment.
16 Jun, 2026, 04:43

Deleting the node modules folder fixes it, however the starter has a gitignore which ignores the node_modules folder, so the appwrite cli seems to ignore it and upload it anyway

17 Jun, 2026, 14:41

could you share the version of the CLI your using ? since your selfhosted it shouldn't be the latest version but 17 for the CLI (https://appwrite.io/docs/advanced/self-hosting/installation#sdk-version-compatibility).

Also when using the CLI to push a function the CLI will check :

  • your .env, and exclude everything from there
  • the appwrite.config.json (or appwrite.json) exclude propery
  • default appwrite CLI exclude (tho idk if there is the node_modules inside)

When you push the process is like that :

  • the CLI bundle the source part of the function (usualy same as the git repository) into a tgz
  • it send the tgz to appwrite, then build in appwrite
  • and if the build success, it deploy it (if you have set the --activate)

And since it's permission related, are the projects file using specific permissions that maybe the user inside the build process can't use ? (if you dev on windows, it shouldn't be relevent)

17 Jun, 2026, 16:08

Yes, appwrite cli version is 17. I made the mistake of updating and it was really hard to figure out which version i can use with my selfhosted version. Did the feature only come with a later version?

  • The env file only contains project name, id and endpoint
  • The appwrite config json does not have an exclude property
  • .gitignore exists but i am using a template NOT currently connected to a repository
  • i am on windows.

When pushing the site, the cli claims its using ignores from the .gitignore file, which clearly isnt the case (and also explains why i had the size limit exceeded).

Deleting my node modules folder works just fine. Its not getting pushed and used in the build process (but recreated, as it should). However deleting my node modules folder every time i want to push an update is .. a really bad experience.

17 Jun, 2026, 16:27

mb i meant .gitignore not .env sorry (i was working on a .env at work and wrongly wrote .env here)

also idk if the cli differ if it is in a git repo or not for the .gitignore

17 Jun, 2026, 16:29

maybe either try to add the appwrite.config.json property to exclude the folder or to git init to load a git repo in local and see if the node_modules is ignored

i remember having some issues with file/folder copy (as i build on CI and just send the builded to appwrite), i needed to remove the dist folder from the gitignore for it to send it

17 Jun, 2026, 16:35

when searching for the exact config key/docs, i came across this

17 Jun, 2026, 16:35

And given that the cli shows me that it should use the gitignore, i am wondering if there is another issue

17 Jun, 2026, 16:36

and i would prefer using the gitignore file to have everything in one place

17 Jun, 2026, 16:39

And initializing git sadly doesnt make a difference

17 Jun, 2026, 17:14

Just checked the cli code and what the cli outputs is just visually. It doesnt mean the cli is actually going through it

TypeScript
      sites2.map(async (site) => {
        let response = {};
        const ignore3 = site.ignore ? "appwrite.config.json" : ".gitignore";
        let siteExists = false;
        let deploymentCreated = false;
        const updaterRow = new Spinner({
          status: "",
          resource: site.name,
          id: site["$id"],
          end: `Ignoring using: ${ignore3}`
        });
17 Jun, 2026, 19:12

looking at : path.join(dirPath, baseDir, ".gitignore"); it looks like it load the .gitignore in the function code itself, not the root repo directory

17 Jun, 2026, 19:25

Well, the vue site template comes with a gitignore and thats what makes sense and should be used from a user perspective.

Your last sentence is talking about functions, but what about sites?

17 Jun, 2026, 19:25

should be the same, it's both deployments

17 Jun, 2026, 19:28

looking at the vue starter, the site is directly on the root folder, which is why it works. (also if you deploy from the console, iirc it directly use the repo as the base)

but for cli deployments, it use the root path + the base path from the appwrite.config.json it seams

17 Jun, 2026, 19:33

also the way appwrite want users to use the appwrite.config.json is basicly one config file, and then it's a monorepo with all your functions in a functions folder, and all your sites in a sites folder, and the rest in the config itself (like database, tables, columns, ...)

TypeScript
./
|- functions/
|- |- my-function/
|- |- other-function/
|- sites/
|- |- my-site/
|- appwrite.config.json

but it's also possible to do it directly on the root project using "path": "." in the appwrite.config.json

for example my nextjs config is like that :

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more