Mon projet est grand. Dans la dernière version, j'ai ajouté une grande partie de nouvelles fonctionnalités. Processus de construction me donnant ce journal des erreurs.
La modification de --max-old-space-size = 4096
ne fonctionne pas pour moi.
{Erreur: la commande a échoué: ng build --prod --configuration = config --output-path = test --base-href = / test /
ERREUR FATALE: Échec de l'allocation des marques-compactes inefficaces près de la limite du tas - Mémoire JavaScript insuffisante
1: 0x8dbaa0 node :: Abort () [ng build --prod --configuration = config --output-path = test --base-href = / test /]
2: 0x8dbaec [ng build --prod --configuration = config --output-path = test --base-href = / test /]
3: 0xad83de v8 :: Utils :: ReportOOMFailure (v8 :: internal :: Isolate *, char const *, bool) [ng build --prod --configuration = config --output-path = test --base-href = /tester/]
4: 0xad8614 v8 :: internal :: V8 :: FatalProcessOutOfMemory (v8 :: internal :: Isolate *, char const *, bool) [ng build --prod --configuration = config --output-path = test --base -href = / test /]
5: 0xec5c42 [ng build --prod --configuration = config --output-path = test --base-href = / test /]
6: 0xec5d48 v8 :: internal :: Heap :: CheckIneffectiveMarkCompact (unsigned long, double) [ng build --prod --configuration = config --output-path = test --base-href = / test /]
7: 0xed1e22 v8 :: internal :: Heap :: PerformGarbageCollection (v8 :: internal :: GarbageCollector, v8 :: GCCallbackFlags) [ng build --prod --configuration = config --output-path = test --base-href = / test /]
8: 0xed2754 v8 :: internal :: Heap :: CollectGarbage (v8 :: internal :: AllocationSpace, v8 :: internal :: GarbageCollectionReason, v8 :: GCCallbackFlags) [ng build --prod --configuration = config --output- chemin = test --base-href = / test /]
9: 0xed53c1 v8 :: internal :: Heap :: AllocateRawWithRetryOrFail (int, v8 :: internal :: AllocationSpace, v8 :: internal :: AllocationAlignment) [ng build --prod --configuration = config --output-path = test --base-href = / test /]
10: 0xe9d636 [ng build --prod --configuration = config --output-path = test --base-href = / test /]
11: 0xeafee7 v8 :: internal :: Factory :: NewLoadHandler (int) [ng build --prod --configuration = config --output-path = test --base-href = / test /]
12: 0xf2f4db v8 :: internal :: LoadHandler :: LoadFromPrototype (v8 :: internal :: Isolate *, v8 :: internal :: Handle
3 Réponses :
Pouvez-vous essayer --max-old-space-size = 8192 avec la commande prod ci-dessous
node --max-old-space-size=8192 ./node_modules/@angular/cli/bin/ng build --aot=true --optimization=true --source-map=false
Je pense que le principal problème est que vous devez utiliser des traits de soulignement plutôt que des tirets.
--max_old_space_size=4096
4096 pourrait ne pas suffire, vous pouvez essayer de l'augmenter à 8192 comme suggéré.
Ajoutez la commande npm dans package.json aux scripts comme ci-dessous:
"scripts": {
"ng": "ng",
"start": "ng serve",
"go": "node --max_old_space_size = 8192 ./node_modules/@angular/cli/bin/ng serve",
.
.
puis en ligne de commande ou dans le terminal, utilisez npm run go
Pouvez-vous partager la commande de construction s'il vous plaît?
Vous devez vérifier la piscine, remplacer la piscine de «ubuntu-latest» de «windows-latest» Cela a résolu mon problème.