npm Webpack code ELIFECYCLE errno 1

Donnerstag, 12. Mai 2022, 17:12 Uhr

When building the PiCockpit frontend code (which is packaged using Webpack) on a different computer, I ran into the following issue:

cross-env NODE_ENV=production webpack –progress –hide-modules –mode=production
type: ‘object’,
additionalProperties: true,
properties: {
apply: {
description: ‘The run point of the plugin, required method.’,
instanceof: ‘Function’,
tsType: “(compiler: import(‘../lib/Compiler’)) => void”
}
},
required: [ ‘apply’ ]
}
},
title: ‘WebpackOptions’,
description: ‘Options object as provided by the user.’,
type: ‘object’,
additionalProperties: false,
properties: {
amd: { ‘$ref’: ‘#/definitions/Amd’ },
bail: { ‘$ref’: ‘#/definitions/Bail’ },
cache: { ‘$ref’: ‘#/definitions/CacheOptions’ },
context: { ‘$ref’: ‘#/definitions/Context’ },
dependencies: { ‘$ref’: ‘#/definitions/Dependencies’ },
devServer: { ‘$ref’: ‘#/definitions/DevServer’ },
devtool: { ‘$ref’: ‘#/definitions/DevTool’ },
entry: { ‘$ref’: ‘#/definitions/Entry’ },
experiments: { ‘$ref’: ‘#/definitions/Experiments’ },
externals: { ‘$ref’: ‘#/definitions/Externals’ },
externalsPresets: { ‘$ref’: ‘#/definitions/ExternalsPresets’ },
externalsType: { ‘$ref’: ‘#/definitions/ExternalsType’ },
ignoreWarnings: { ‘$ref’: ‘#/definitions/IgnoreWarnings’ },
infrastructureLogging: { ‘$ref’: ‘#/definitions/InfrastructureLogging’ },
loader: { ‘$ref’: ‘#/definitions/Loader’ },
mode: { ‘$ref’: ‘#/definitions/Mode’ },
module: { ‘$ref’: ‘#/definitions/ModuleOptions’ },
name: { ‘$ref’: ‘#/definitions/Name’ },
node: { ‘$ref’: ‘#/definitions/Node’ },
optimization: { ‘$ref’: ‘#/definitions/Optimization’ },
output: { ‘$ref’: ‘#/definitions/Output’ },
parallelism: { ‘$ref’: ‘#/definitions/Parallelism’ },
performance: { ‘$ref’: ‘#/definitions/Performance’ },
plugins: { ‘$ref’: ‘#/definitions/Plugins’ },
profile: { ‘$ref’: ‘#/definitions/Profile’ },
recordsInputPath: { ‘$ref’: ‘#/definitions/RecordsInputPath’ },
recordsOutputPath: { ‘$ref’: ‘#/definitions/RecordsOutputPath’ },
recordsPath: { ‘$ref’: ‘#/definitions/RecordsPath’ },
resolve: { ‘$ref’: ‘#/definitions/Resolve’ },
resolveLoader: { ‘$ref’: ‘#/definitions/ResolveLoader’ },
snapshot: { ‘$ref’: ‘#/definitions/SnapshotOptions’ },
stats: { ‘$ref’: ‘#/definitions/StatsValue’ },
target: { ‘$ref’: ‘#/definitions/Target’ },
watch: { ‘$ref’: ‘#/definitions/Watch’ },
watchOptions: { ‘$ref’: ‘#/definitions/WatchOptions’ }
}
},
headerName: ‘Webpack’,
baseDataPath: ‘configuration’,
postFormatter: [Function: postFormatter]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! picockpit-frontend@1.1.0 build: cross-env NODE_ENV=production webpack --progress --hide-modules --mode=production
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the picockpit-frontend@1.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\…\AppData\Roaming\npm-cache_logs\2022-05-12T15_01_47_281Z-debug.log

Fixes

The typical suggestion online to fix this error is to remove node_modules, to remove package-lock.json and to reinstall the modules using npm install.

This did not work for me, the error persisted.

Here is what worked:

I looked at webpack.config.js and disabled parts of it, until I had my culprit. The two following lines had to be commented out, to make the configuration work:

// devtool: ‘#eval-source-map’,

// module.exports.devtool = ‘#source-map’

It might be different in your case – I recommend to try and experiment with webpack.config.js as necessary.

Der Beitrag npm Webpack code ELIFECYCLE errno 1 erschien zuerst auf pi3g.com.


pi3g e.K.

Als approved Raspberry Pi Reseller in Deutschland arbeiten wir seit Anfang an (2012) besonders eng mit Raspberry Pi zusammen. Wir bieten ehrliche, tiefe technische Kompetenz rund um den Raspberry Pi. Wir vertreiben Raspberry Pi sowie Coral AI hardware, und entwickeln Hardware und Software für unsere Kunden.

Unsere Plattform picockpit.com ermöglicht Nutzern ihre Pis von überall aus ganz leicht per Webinterface zu nutzen. Unsere Apps lösen echte Probleme und machen Nutzer glücklich.