{"id":29153,"date":"2022-05-12T17:12:40","date_gmt":"2022-05-12T15:12:40","guid":{"rendered":"https:\/\/pi3g.com\/?p=29153"},"modified":"2022-05-12T17:12:40","modified_gmt":"2022-05-12T15:12:40","slug":"npm-webpack-code-elifecycle-errno-1","status":"publish","type":"post","link":"https:\/\/pi3g.com\/de\/npm-webpack-code-elifecycle-errno-1\/","title":{"rendered":"npm Webpack-Code ELIFECYCLE errno 1"},"content":{"rendered":"\n<p>When building the PiCockpit frontend code (which is packaged using Webpack) on a different computer, I ran into the following issue:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>cross-env NODE_ENV=production webpack &#8211;progress &#8211;hide-modules &#8211;mode=production<br>type: &#8216;object&#8217;,<br>additionalProperties: true,<br>properties: {<br>apply: {<br>description: &#8216;The run point of the plugin, required method.&#8217;,<br>instanceof: &#8216;Function&#8217;,<br>tsType: &#8220;(compiler: import(&#8216;..\/lib\/Compiler&#8217;)) => void&#8221;<br>}<br>},<br>required: [ &#8216;apply&#8217; ]<br>}<br>},<br>title: &#8216;WebpackOptions&#8217;,<br>description: &#8216;Options object as provided by the user.&#8217;,<br>type: &#8216;object&#8217;,<br>additionalProperties: false,<br>properties: {<br>amd: { &#8216;$ref&#8217;: &#8216;#\/definitions\/Amd&#8217; },<br>bail: { &#8216;$ref&#8217;: &#8216;#\/definitions\/Bail&#8217; },<br>cache: { &#8216;$ref&#8217;: &#8216;#\/definitions\/CacheOptions&#8217; },<br>context: { &#8216;$ref&#8217;: &#8216;#\/definitions\/Context&#8217; },<br>dependencies: { &#8216;$ref&#8217;: &#8216;#\/definitions\/Dependencies&#8217; },<br>devServer: { &#8216;$ref&#8217;: &#8216;#\/definitions\/DevServer&#8217; },<br>devtool: { &#8216;$ref&#8217;: &#8216;#\/definitions\/DevTool&#8217; },<br>entry: { &#8216;$ref&#8217;: &#8216;#\/definitions\/Entry&#8217; },<br>experiments: { &#8216;$ref&#8217;: &#8216;#\/definitions\/Experiments&#8217; },<br>externals: { &#8216;$ref&#8217;: &#8216;#\/definitions\/Externals&#8217; },<br>externalsPresets: { &#8216;$ref&#8217;: &#8216;#\/definitions\/ExternalsPresets&#8217; },<br>externalsType: { &#8216;$ref&#8217;: &#8216;#\/definitions\/ExternalsType&#8217; },<br>ignoreWarnings: { &#8216;$ref&#8217;: &#8216;#\/definitions\/IgnoreWarnings&#8217; },<br>infrastructureLogging: { &#8216;$ref&#8217;: &#8216;#\/definitions\/InfrastructureLogging&#8217; },<br>loader: { &#8216;$ref&#8217;: &#8216;#\/definitions\/Loader&#8217; },<br>mode: { &#8216;$ref&#8217;: &#8216;#\/definitions\/Mode&#8217; },<br>module: { &#8216;$ref&#8217;: &#8216;#\/definitions\/ModuleOptions&#8217; },<br>name: { &#8216;$ref&#8217;: &#8216;#\/definitions\/Name&#8217; },<br>node: { &#8216;$ref&#8217;: &#8216;#\/definitions\/Node&#8217; },<br>optimization: { &#8216;$ref&#8217;: &#8216;#\/definitions\/Optimization&#8217; },<br>output: { &#8216;$ref&#8217;: &#8216;#\/definitions\/Output&#8217; },<br>parallelism: { &#8216;$ref&#8217;: &#8216;#\/definitions\/Parallelism&#8217; },<br>performance: { &#8216;$ref&#8217;: &#8216;#\/definitions\/Performance&#8217; },<br>plugins: { &#8216;$ref&#8217;: &#8216;#\/definitions\/Plugins&#8217; },<br>profile: { &#8216;$ref&#8217;: &#8216;#\/definitions\/Profile&#8217; },<br>recordsInputPath: { &#8216;$ref&#8217;: &#8216;#\/definitions\/RecordsInputPath&#8217; },<br>recordsOutputPath: { &#8216;$ref&#8217;: &#8216;#\/definitions\/RecordsOutputPath&#8217; },<br>recordsPath: { &#8216;$ref&#8217;: &#8216;#\/definitions\/RecordsPath&#8217; },<br>resolve: { &#8216;$ref&#8217;: &#8216;#\/definitions\/Resolve&#8217; },<br>resolveLoader: { &#8216;$ref&#8217;: &#8216;#\/definitions\/ResolveLoader&#8217; },<br>snapshot: { &#8216;$ref&#8217;: &#8216;#\/definitions\/SnapshotOptions&#8217; },<br>stats: { &#8216;$ref&#8217;: &#8216;#\/definitions\/StatsValue&#8217; },<br>target: { &#8216;$ref&#8217;: &#8216;#\/definitions\/Target&#8217; },<br>watch: { &#8216;$ref&#8217;: &#8216;#\/definitions\/Watch&#8217; },<br>watchOptions: { &#8216;$ref&#8217;: &#8216;#\/definitions\/WatchOptions&#8217; }<br>}<br>},<br>headerName: &#8216;Webpack&#8217;,<br>baseDataPath: &#8216;configuration&#8217;,<br>postFormatter: [Function: postFormatter]<br>}<br><strong>npm ERR! code ELIFECYCLE<\/strong><br><strong>npm ERR! errno 1<\/strong><br>npm ERR! picockpit-frontend@1.1.0 build: <code>cross-env NODE_ENV=production webpack --progress --hide-modules --mode=production<\/code><br>npm ERR! Exit status 1<br>npm ERR!<br>npm ERR! Failed at the picockpit-frontend@1.1.0 build script.<br>npm ERR! This is probably not a problem with npm. There is likely additional logging output above.<\/p><\/blockquote>\n\n\n\n<p>npm ERR! A complete log of this run can be found in:<br>npm ERR! C:\\Users\\&#8230;\\AppData\\Roaming\\npm-cache_logs\\2022-05-12T15_01_47_281Z-debug.log<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Fixes<\/h2>\n\n\n\n<p>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. <\/p>\n\n\n\n<p><strong>This did not work for me, the error persisted<\/strong>. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Here is what<strong> worked: <\/strong><\/h2>\n\n\n\n<p>I looked at <strong>webpack.config.js<\/strong> and disabled parts of it, until I had my culprit. The two following lines had to be commented out, to make the configuration work:<\/p>\n\n\n\n<p>\/\/ devtool: &#8216;#eval-source-map&#8217;,<\/p>\n\n\n\n<p>\/\/ module.exports.devtool = &#8216;#source-map&#8217;<\/p>\n\n\n\n<p>It might be different in your case &#8211; I recommend to try and experiment with webpack.config.js as necessary.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8211;progress &#8211;hide-modules &#8211;mode=productiontype: &#8216;object&#8217;,additionalProperties: true,properties: {apply: {description: &#8216;The run point of the plugin, required method.&#8217;,instanceof: &#8216;Function&#8217;,tsType: &#8220;(compiler: import(&#8216;..\/lib\/Compiler&#8217;)) => void&#8221;}},required: [ &#8216;apply&#8217; ]}},title: &#8216;WebpackOptions&#8217;,description: &#8216;Options object as provided by the user.&#8217;,type:&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[402,822],"tags":[993,992,826,990,991,731],"class_list":["post-29153","post","type-post","status-publish","format-standard","hentry","category-development","category-javascript","tag-build","tag-elifecycle","tag-error","tag-node-js","tag-npm","tag-webpack"],"_links":{"self":[{"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/posts\/29153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/comments?post=29153"}],"version-history":[{"count":1,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/posts\/29153\/revisions"}],"predecessor-version":[{"id":29154,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/posts\/29153\/revisions\/29154"}],"wp:attachment":[{"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/media?parent=29153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/categories?post=29153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pi3g.com\/de\/wp-json\/wp\/v2\/tags?post=29153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}