|
@@ -0,0 +1,73 @@
|
|
|
|
|
+# Environment check script
|
|
|
|
|
+Write-Host "Checking development environment..." -ForegroundColor Cyan
|
|
|
|
|
+Write-Host "================================" -ForegroundColor Cyan
|
|
|
|
|
+
|
|
|
|
|
+# Check Node.js
|
|
|
|
|
+Write-Host "`nChecking Node.js..." -ForegroundColor Yellow
|
|
|
|
|
+$nodeVersion = node --version 2>$null
|
|
|
|
|
+if ($nodeVersion) {
|
|
|
|
|
+ Write-Host "✓ Node.js: $nodeVersion" -ForegroundColor Green
|
|
|
|
|
+} else {
|
|
|
|
|
+ Write-Host "✗ Node.js is not installed" -ForegroundColor Red
|
|
|
|
|
+ # Download nodejs
|
|
|
|
|
+ Write-Host "Downloading Node.js..." -ForegroundColor Yellow
|
|
|
|
|
+ npm install -g node
|
|
|
|
|
+ if ($LASTEXITCODE -ne 0) {
|
|
|
|
|
+ Write-Host "✗ Node.js download failed" -ForegroundColor Red
|
|
|
|
|
+ exit 1
|
|
|
|
|
+ }
|
|
|
|
|
+ Write-Host "✓ Node.js downloaded successfully" -ForegroundColor Green
|
|
|
|
|
+ node --version
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+# Check npm
|
|
|
|
|
+Write-Host "`nChecking npm..." -ForegroundColor Yellow
|
|
|
|
|
+$npmVersion = npm --version 2>$null
|
|
|
|
|
+if ($npmVersion) {
|
|
|
|
|
+ Write-Host "✓ npm: $npmVersion" -ForegroundColor Green
|
|
|
|
|
+} else {
|
|
|
|
|
+ Write-Host "✗ npm is not installed" -ForegroundColor Red
|
|
|
|
|
+ # Download npm
|
|
|
|
|
+ Write-Host "Downloading npm..." -ForegroundColor Yellow
|
|
|
|
|
+ npm install -g npm
|
|
|
|
|
+ if ($LASTEXITCODE -ne 0) {
|
|
|
|
|
+ Write-Host "✗ npm download failed" -ForegroundColor Red
|
|
|
|
|
+ exit 1
|
|
|
|
|
+ }
|
|
|
|
|
+ Write-Host "✓ npm downloaded successfully" -ForegroundColor Green
|
|
|
|
|
+ npm --version
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+# Check if dependencies are installed
|
|
|
|
|
+Write-Host "`nChecking project dependencies..." -ForegroundColor Yellow
|
|
|
|
|
+if (Test-Path "node_modules") {
|
|
|
|
|
+ Write-Host "✓ node_modules exists" -ForegroundColor Green
|
|
|
|
|
+} else {
|
|
|
|
|
+ Write-Host "✗ node_modules does not exist, installing dependencies..." -ForegroundColor Yellow
|
|
|
|
|
+ npm install
|
|
|
|
|
+ if ($LASTEXITCODE -ne 0) {
|
|
|
|
|
+ Write-Host "✗ Dependency installation failed" -ForegroundColor Red
|
|
|
|
|
+ exit 1
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+# Check if python is installed
|
|
|
|
|
+Write-Host "`nChecking if python is installed..." -ForegroundColor Yellow
|
|
|
|
|
+$pythonVersion = python --version 2>$null
|
|
|
|
|
+if ($pythonVersion) {
|
|
|
|
|
+ Write-Host "✓ python: $pythonVersion" -ForegroundColor Green
|
|
|
|
|
+} else {
|
|
|
|
|
+ Write-Host "✗ python is not installed" -ForegroundColor Red
|
|
|
|
|
+ # Download python
|
|
|
|
|
+ Write-Host "Downloading python..." -ForegroundColor Yellow
|
|
|
|
|
+ npm install -g python
|
|
|
|
|
+ if ($LASTEXITCODE -ne 0) {
|
|
|
|
|
+ Write-Host "✗ python download failed" -ForegroundColor Red
|
|
|
|
|
+ exit 1
|
|
|
|
|
+ }
|
|
|
|
|
+ Write-Host "✓ python downloaded successfully" -ForegroundColor Green
|
|
|
|
|
+ python --version
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+Write-Host "`n================================" -ForegroundColor Cyan
|
|
|
|
|
+Write-Host "Environment check completed!" -ForegroundColor Green
|