codice npm Webpack ELIFECYCLE errno 1

Quando ho creato il codice del frontend di PiCockpit (che è confezionato con Webpack) su un altro computer, ho riscontrato il seguente problema:

cross-env NODE_ENV=produzione webpack -progress -hide-modules -mode=produzione
tipo: 'oggetto',
additionalProperties: true,
proprietà: {
applicare: {
description: 'Il punto di esecuzione del plugin, metodo richiesto',
istanza di: 'Funzione',
tsType: "(compilatore: import('../lib/Compilatore')) => void"
}
},
richiesto: [ 'apply' ]
}
},
title: 'WebpackOptions',
description: "Oggetto opzioni fornito dall'utente",
tipo: 'oggetto',
additionalProperties: false,
proprietà: {
amd: {'$ref': '#/definitions/Amd' },
cauzione: {'$ref': '#/definitions/Bail' },
cache: {'$ref': '#/definitions/CacheOptions' },
contesto: {'$ref': '#/definitions/Context' },
dipendenze: {'$ref': '#/definitions/Dependencies' },
devServer: {'$ref': '#/definitions/DevServer' },
devtool: {'$ref': '#/definitions/DevTool' },
voce: {'$ref': '#/definitions/Entry' },
esperimenti: {'$ref': '#/definitions/Experiments' },
esterni: {'$ref': '#/definitions/Externals' },
externalsPresets: {'$ref': '#/definitions/ExternalsPresets' },
externalsType: {'$ref': '#/definitions/ExternalsType' },
ignoreWarnings: {'$ref': '#/definitions/IgnoreWarnings' },
infrastructureLogging: {'$ref': '#/definitions/InfrastructureLogging' },
loader: {'$ref': '#/definitions/Loader' },
modalità: {'$ref': '#/definitions/Mode' },
modulo: {'$ref': '#/definitions/ModuleOptions' },
name: { '$ref': '#/definitions/Name' },
nodo: {'$ref': '#/definitions/Node' },
ottimizzazione: {'$ref': '#/definitions/Optimization' },
output: {'$ref': '#/definitions/Output' },
parallelismo: { '$ref': '#/definitions/Parallelism' },
performance: {'$ref': '#/definitions/Performance' },
plugin: {'$ref': '#/definitions/Plugins' },
profilo: {'$ref': '#/definitions/Profile' },
recordsInputPath: { '$ref': '#/definitions/RecordsInputPath' },
recordsOutputPath: { '$ref': '#/definitions/RecordsOutputPath' },
recordsPath: { '$ref': '#/definitions/RecordsPath' },
risolvere: {'$ref': '#/definitions/Resolve' },
resolveLoader: {'$ref': '#/definitions/ResolveLoader' },
snapshot: {'$ref': '#/definitions/SnapshotOptions' },
statistiche: {'$ref': '#/definitions/StatsValue' },
target: { '$ref': '#/definitions/Target' },
watch: {'$ref': '#/definitions/Watch' },
watchOptions: { '$ref': '#/definitions/WatchOptions' }
}
},
headerName: 'Webpack',
baseDataPath: 'configurazione',
postFormatter: [Funzione: postFormatter]
}
npm ERR! codice ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: cross-env NODE_ENV=produzione webpack --progress --hide-modules --mode=produzione
npm ERR! Stato di uscita 1
npm ERR!
npm ERR! Errore nello script di compilazione [email protected].
npm ERR! Probabilmente non si tratta di un problema con npm. Probabilmente c'è un output di log aggiuntivo sopra.

npm ERR! Il log completo di questa esecuzione è disponibile in:
npm ERR! C:\Users\…\AppData\Roaming\npm-cache_logs\2022-05-12T15_01_47_281Z-debug.log

Correzioni

Il tipico suggerimento online per risolvere questo errore è di rimuovere node_modules, rimuovere package-lock.json e reinstallare i moduli usando npm install.

Questo non ha funzionato per me, l'errore persisteva..

Ecco cosa lavorato:

Ho guardato webpack.config.js e ne ho disabilitato alcune parti, finché non ho trovato il colpevole. Per far funzionare la configurazione è stato necessario commentare le due righe seguenti:

// devtool: '#eval-source-map',

// module.exports.devtool = '#source-map'

Potrebbe essere diverso nel vostro caso: vi consiglio di provare e sperimentare con webpack.config.js se necessario.