File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -20,13 +20,28 @@ source /etc/hestiacp/hestia.conf
2020source $HESTIA /func/main.sh
2121# load config file
2222source_conf " $HESTIA /conf/hestia.conf"
23+ # define NodeJS version for download (required for building JS/CSS)
24+ nodejs_ver=" 20"
2325
2426# Perform verification if read-only mode is enabled
2527check_hestia_demo_mode
2628
29+ # Detect and install NodeJS if necessary
2730if [ -z $( which " node" ) ]; then
28- echo " Unable to locate Node.js See https://hestiacp.com/docs/contributing/development.html"
29- exit 0
31+ read -p " NodeJS not found. Install now to proceed? [Y/n] " answer
32+ if [ " $answer " = ' y' ] || [ " $answer " = ' Y' ]; then
33+ if [ " $OS_TYPE " = " Debian" ]; then
34+ # Debian
35+ curl -fsSL " https://deb.nodesource.com/setup_$nodejs_ver .x" | bash - && \
36+ apt-get install -y nodejs
37+ else
38+ # Ubuntu
39+ curl -fsSL " https://deb.nodesource.com/setup_$nodejs_ver .x" | sudo -E bash - && \
40+ sudo apt-get install -y nodejs
41+ fi
42+ else
43+ exit 0
44+ fi
3045fi
3146
3247# Define download function
You can’t perform that action at this time.
0 commit comments