Netlify deploy error due to vite CLI permission issue#1
Open
netlify-coding[bot] wants to merge 1 commit into
Open
Netlify deploy error due to vite CLI permission issue#1netlify-coding[bot] wants to merge 1 commit into
netlify-coding[bot] wants to merge 1 commit into
Conversation
✅ Deploy Preview for chain-cert ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 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
✅ Result: The Netlify deploy was failing with a "Permission denied" error when the build system tried to run the
viteCLI executable. The underlying cause was that thenode_modulesdirectory had been committed to git in a prior commit. When git stores files, it does not preserve the executable bit on binaries — sonode_modules/.bin/vitelanded in the repository as a non-executable file (-rw-r--r--). When Netlify cloned the repo and tried to runvite 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 tonode node_modules/vite/bin/vite.js buildand the publish directory todist. 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.jsfile, which was intact.package.json: Thebuildscript was updated fromvite buildtonode node_modules/vite/bin/vite.js buildso that runningnpm run buildlocally 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_modulesdirectory from the git repository and rely on Netlify's automatic dependency installation, which would avoid this class of permission issue entirely.