fix(docker): install node dependencies in init.sh#4854
Open
palash018 wants to merge 5 commits into
Open
Conversation
`bench init` clones the Frappe app but does not install its Node dependencies. When `bench start` later launches the socketio service, it fails because `socket.io` is missing from `apps/frappe/node_modules`. Also fixes the shebang (`#!bin/bash` -> `#!/bin/bash`) and adds an early `exit 0` so the script does not fall through to `bench init` when the bench already exists. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Confidence Score: 5/5This looks safe to merge.
Reviews (5): Last reviewed commit: "fix(docker): export NVM PATH before any ..." | Re-trigger Greptile |
Ensure the subshell running `yarn install` exits the script on failure so `bench start` is never reached with missing Node dependencies. Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
If the bench already exists but its `node_modules` were removed or never installed, the early-exit branch now installs them before starting the bench. Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Always run yarn install (both for freshly initialized and pre-existing benches) instead of skipping based on directory/package existence checks, which could miss stale or partially installed dependencies. Factor the install step into a helper to keep both call sites in sync. Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
palash018
marked this pull request as draft
July 5, 2026 09:37
Move the Node/NVM PATH export to the top of the script so `yarn` is available in the existing-bench branch before `install_node_deps` runs, instead of relying on the Docker image's default PATH. Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
palash018
marked this pull request as ready for review
July 5, 2026 09:40
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.
Closes #4845
Summary
bench initclones the Frappe app but does not install its Node dependencies. Whenbench startlater launches the socketio service, it fails becausesocket.iois missing fromapps/frappe/node_modules.This PR ensures
apps/frappe/node_modulesis installed beforebench startis reached, and that the script aborts if the installation fails.Also includes small fixes in
docker/init.sh:#!bin/bashto#!/bin/bash.exit 0after the early "bench already exists" branch so the script does not fall through and attemptbench initagain.PATHexport to the top soyarnis available in both the fresh-bench and existing-bench paths.Changes
docker/init.sh:bench initon fresh benches.bench start.yarn installfails sobench startnever runs with missing dependencies.yarninvocation.Test plan
docker compose downanddocker compose upin thedocker/directory.frappecontainer completes initialization withoutCannot find module 'socket.io'errors.bench startlaunches web, socketio, schedule, and worker processes successfully.Generated with Devin