-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdiagnostic.js
More file actions
71 lines (60 loc) · 2.07 KB
/
diagnostic.js
File metadata and controls
71 lines (60 loc) · 2.07 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
#!/usr/bin/env node
console.log('🔍 Post-Dost Diagnostic Tool\n');
// Check Node.js version
const nodeVersion = process.version;
console.log(`📋 Node.js version: ${nodeVersion}`);
const majorVersion = parseInt(nodeVersion.split('.')[0].slice(1));
if (majorVersion < 18) {
console.log('❌ Warning: Node.js 18+ is recommended');
} else {
console.log('✅ Node.js version is compatible');
}
// Check if dependencies exist
const fs = require('fs');
const path = require('path');
console.log('\n📦 Checking dependencies...');
const nodeModulesPath = path.join(process.cwd(), 'node_modules');
if (fs.existsSync(nodeModulesPath)) {
console.log('✅ node_modules exists');
// Check key dependencies
const keyDeps = ['next', 'react', 'leaflet', 'react-leaflet'];
keyDeps.forEach(dep => {
const depPath = path.join(nodeModulesPath, dep);
if (fs.existsSync(depPath)) {
console.log(`✅ ${dep} installed`);
} else {
console.log(`❌ ${dep} missing`);
}
});
} else {
console.log('❌ node_modules not found. Run: npm install --legacy-peer-deps');
}
// Check environment file
console.log('\n🔧 Checking environment setup...');
const envPath = path.join(process.cwd(), '.env.local');
if (fs.existsSync(envPath)) {
console.log('✅ .env.local exists');
} else {
console.log('❌ .env.local missing. Run: cp .env.example .env.local');
}
// Check important files
console.log('\n📁 Checking project structure...');
const importantFiles = [
'src/app/layout.tsx',
'src/app/page.tsx',
'src/app/maps/page.tsx',
'src/components/navbar.tsx',
'package.json'
];
importantFiles.forEach(file => {
if (fs.existsSync(path.join(process.cwd(), file))) {
console.log(`✅ ${file}`);
} else {
console.log(`❌ ${file} missing`);
}
});
console.log('\n🎯 Next steps:');
console.log('1. Run: npm install --legacy-peer-deps');
console.log('2. Run: npm run dev');
console.log('3. Open: http://localhost:3000');
console.log('\nIf issues persist, check the browser console for errors.');