Skip to content

Netlify deploy error due to vite CLI permission issue#1

Open
netlify-coding[bot] wants to merge 1 commit into
mainfrom
agent-to-vite-cli-permission-issue-de2f
Open

Netlify deploy error due to vite CLI permission issue#1
netlify-coding[bot] wants to merge 1 commit into
mainfrom
agent-to-vite-cli-permission-issue-de2f

Conversation

@netlify-coding
Copy link
Copy Markdown

🔗 View agent run: https://app.netlify.com/projects/chain-cert/agent-runs/6a1ad8e800e63643a33cde2f

🤖 Agent: Claude

💬 Prompt: The Netlify deploy errored, with the following guidance provided:

Diagnosis

  • Relevant log lines: the build command is run (line 52), the package script is "vite build" (line 54) and the build fails because the shell cannot execute ...

Result: The Netlify deploy was failing with a "Permission denied" error when the build system tried to run the vite CLI executable. The underlying cause was that the node_modules directory had been committed to git in a prior commit. When git stores files, it does not preserve the executable bit on binaries — so node_modules/.bin/vite landed in the repository as a non-executable file (-rw-r--r--). When Netlify cloned the repo and tried to run vite build, the shell refused because the binary lacked execute permissions.

Two changes were made to permanently fix this:

netlify.toml (new file): A Netlify configuration file was created that explicitly sets the build command to node node_modules/vite/bin/vite.js build and the publish directory to dist. Invoking the Vite entry point through Node.js directly bypasses the need for the binary wrapper to be executable — Node.js only needs read permission on the .js file, which was intact.

package.json: The build script was updated from vite build to node node_modules/vite/bin/vite.js build so that running npm run build locally or in any CI environment also uses the safe invocation path, keeping both consistent.

These changes resolve the immediate build failure. The longer-term recommendation is to remove the committed node_modules directory from the git repository and rely on Netlify's automatic dependency installation, which would avoid this class of permission issue entirely.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 30, 2026

Deploy Preview for chain-cert ready!

Name Link
🔨 Latest commit 376ed9c
🔍 Latest deploy log https://app.netlify.com/projects/chain-cert/deploys/6a1ad9a9f568030008d919a1
😎 Deploy Preview https://deploy-preview-1--chain-cert.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant