-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-project-en.bat
More file actions
90 lines (84 loc) · 2.69 KB
/
Copy pathstart-project-en.bat
File metadata and controls
90 lines (84 loc) · 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
@echo off
REM Set code page to UTF-8 to correctly display characters (optional for English)
chcp 65001 > nul
echo Checking if Node.js is installed...
node -v > nul 2>&1
if %errorlevel% neq 0 (
echo.
echo Node.js is not installed.
echo Please visit https://nodejs.org/ to download and install Node.js (LTS version recommended).
echo After installation, please close this window and re-run this script.
echo.
pause
exit /b
)
echo Node.js is installed.
echo.
echo Checking if npm is installed...
npm -v > nul 2>&1
if %errorlevel% neq 0 (
echo.
echo npm is not installed. This is usually installed вместе with Node.js.
echo Please ensure Node.js is installed correctly, or try reinstalling Node.js.
echo After installation, please close this window and re-run this script.
echo.
pause
exit /b
)
echo npm is installed.
echo.
echo Checking if pnpm is installed...
pnpm -v > nul 2>&1
if %errorlevel% neq 0 (
echo.
echo pnpm is not installed.
set /p install_pnpm="Do you want to try installing pnpm globally using npm? (Y/N then press Enter): "
if /i "%install_pnpm%"=="Y" (
echo.
echo Installing pnpm globally (npm install -g pnpm)...
npm install -g pnpm
if %errorlevel% neq 0 (
echo.
echo pnpm installation failed. Please check if npm is working correctly, or try running "npm install -g pnpm" manually in a new command prompt window.
echo If the problem persists, please consult the official pnpm installation documentation.
echo.
pause
exit /b
)
echo pnpm installed successfully.
echo Please note: The newly installed pnpm might require opening a new command prompt window to be used directly in the current path.
echo If subsequent steps fail, please try closing this window, opening a new command prompt, and then re-running this script.
echo.
pause
) else (
echo.
echo User chose not to install pnpm. The script will exit.
echo.
pause
exit /b
)
) else (
echo pnpm is installed.
)
echo.
echo Installing project dependencies (pnpm install)...
pnpm install
if %errorlevel% neq 0 (
echo.
echo "pnpm install" failed. Please check the error messages above.
echo.
pause
exit /b
)
echo Project dependencies installed successfully.
echo.
echo Starting development server (pnpm dev)...
echo.
echo ==================================================
echo To stop the development server, press CTRL+C in this window.
echo ==================================================
echo.
pnpm dev
echo.
echo Development server has stopped or failed to start.
pause