docs: fix cannot finde module 'which'
This commit is contained in:
BIN
docs/troubleshooting/error-which-module.png
Normal file
BIN
docs/troubleshooting/error-which-module.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 65 KiB |
30
docs/troubleshooting/missing-which-module.md
Normal file
30
docs/troubleshooting/missing-which-module.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# ❌ Fehler: Cannot find module 'which'
|
||||
|
||||
## 🧭 Kontext
|
||||
|
||||
Beim Starten der App mit nodeMapService(Windows Dienst) oder "npm start" nach dem ohne
|
||||
`package-lock.json`-Datei trat folgender Fehler auf: 
|
||||
|
||||
```
|
||||
Error: Cannot find module 'which'
|
||||
```
|
||||
|
||||
Dies bedeutet, dass die Bibliothek `which` im `node_modules`-Verzeichnis fehlt, obwohl sie
|
||||
möglicherweise früher vorhanden war.
|
||||
|
||||
---
|
||||
|
||||
## 🛠️ Lösung
|
||||
|
||||
Da `which` nicht mehr im aktuellen `node_modules` verzeichnis vorhanden war:
|
||||
|
||||
1. **Altes funktionierendes Projekt geöffnet**
|
||||
→ Dort war die Bibliothek im `node_modules`-Verzeichnis noch vorhanden.
|
||||
|
||||
2. **Verzeichnis `node_modules/which` gezippt**
|
||||
→ als `which.zip` gespeichert.
|
||||
|
||||
3. **ZIP-Datei auf den Zielserver übertragen**
|
||||
→ Manuell entpackt in das entsprechende `node_modules/which`-Verzeichnis.
|
||||
|
||||
4. **App gestartet → Funktioniert wieder.**
|
||||
60
docs/troubleshooting/npm-ci-vs-install.md
Normal file
60
docs/troubleshooting/npm-ci-vs-install.md
Normal file
@@ -0,0 +1,60 @@
|
||||
# 📦 Problem mit Abhängigkeiten und npm-Fehlern
|
||||
|
||||
**Datum:** 17.06.2025
|
||||
|
||||
## ❓ Problem
|
||||
|
||||
Nach einem Update oder manuellem Eingriff traten folgende Probleme auf:
|
||||
|
||||
- `npm run dev` funktionierte nicht mehr.
|
||||
- Fehlermeldungen wie `Cannot find module 'which`, `tailwindcss`, oder 500er Fehler beim Start.
|
||||
- Konflikte in `package-lock.json`, z. B. bei `@mui/material`.
|
||||
|
||||
---
|
||||
|
||||
## 🛠️ Lösungsschritte
|
||||
|
||||
### 1. ❌ Komplett zurücksetzen
|
||||
|
||||
Lösche folgende Ordner und Dateien:
|
||||
|
||||
```bash
|
||||
node_modules, package-lock.json, package.json, .next
|
||||
```
|
||||
|
||||
### 2. 🧱 Alte funktionierende `package-lock.json` verwenden
|
||||
|
||||
Füge die gesicherte Version wieder ein.
|
||||
|
||||
### 3. 📦 Neu installieren
|
||||
|
||||
```bash
|
||||
npm ci
|
||||
```
|
||||
|
||||
> Wichtig: `npm ci` verwendet exakt die Versionen aus der `package-lock.json`.
|
||||
|
||||
### 4. 📝 Alte `package.json` zurückholen
|
||||
|
||||
Falls nötig, auch die alte `package.json` ersetzen.
|
||||
|
||||
### 5. 🚀 Projekt starten
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## ✅ Empfehlung für die Zukunft
|
||||
|
||||
- **Immer `package.json` und `package-lock.json` sichern**, wenn eine Version stabil funktioniert.
|
||||
- **Husky-Hook** verwenden, um Version bei jedem Commit automatisch zu erhöhen.
|
||||
- Zusätzlich kannst du `node_modules-v1.1.xxx.zip` archivieren.
|
||||
|
||||
---
|
||||
|
||||
## 🗂️ Dateiablage
|
||||
|
||||
Diese Datei wurde erstellt für zukünftige Referenz und liegt in
|
||||
`/docs/troubleshooting/npm-ci-vs-install.md`.
|
||||
BIN
docs/troubleshooting/screenshots/error-which-module.png
Normal file
BIN
docs/troubleshooting/screenshots/error-which-module.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 65 KiB |
Reference in New Issue
Block a user