title: What could possibly be causing this "write EOF" error after typing the "npx webpack" command?
body: <p>Okay, I have a webpack project that I want to build/compile. My package.json is here:</p>
  <pre><code>{
  &quot;name&quot;: &quot;project-name&quot;,
  &quot;version&quot;: &quot;1.0.0&quot;,
  &quot;description&quot;: &quot;&quot;,
  &quot;main&quot;: &quot;index.js&quot;,
  &quot;scripts&quot;: {
      &quot;build&quot;: &quot;webpack&quot;
  },
  &quot;author&quot;: &quot;&quot;,
  &quot;license&quot;: &quot;ISC&quot;,
  &quot;devDependencies&quot;: {
      &quot;chokidar&quot;: &quot;3.4.0&quot;,
      &quot;clean-webpack-plugin&quot;: &quot;^3.0.0&quot;,
      &quot;closure-webpack-plugin&quot;: &quot;^2.3.0&quot;,
      &quot;copy-webpack-plugin&quot;: &quot;^5.1.1&quot;,
      &quot;google-closure-compiler&quot;: &quot;^20200504.0.0&quot;,
      &quot;lodash&quot;: &quot;^4.17.19&quot;,
      &quot;minimatch&quot;: &quot;^3.0.4&quot;,
      &quot;raw-loader&quot;: &quot;^4.0.1&quot;,
      &quot;terser-webpack-plugin&quot;: &quot;^3.0.1&quot;,
      &quot;uglify-loader&quot;: &quot;^3.0.0&quot;,
      &quot;webpack&quot;: &quot;^4.43.0&quot;,
      &quot;webpack-cli&quot;: &quot;^3.3.12&quot;,
      &quot;webpack-obfuscator&quot;: &quot;^0.28.0&quot;,
      &quot;zip-folder&quot;: &quot;^1.0.0&quot;
  },
  &quot;dependencies&quot;: {
      &quot;crypto-js&quot;: &quot;^4.0.0&quot;,
      &quot;jquery&quot;: &quot;^3.5.1&quot;,
      &quot;prettier&quot;: &quot;^2.0.5&quot;,
      &quot;semver&quot;: &quot;^7.3.2&quot;,
      &quot;sweetalert&quot;: &quot;^2.1.2&quot;,
      &quot;sync-request&quot;: &quot;^6.1.0&quot;,
      &quot;versioning&quot;: &quot;^1.1.0&quot;,
      &quot;webpack-build-notifier&quot;: &quot;^2.0.0&quot;,
      &quot;webpack-closure-compiler&quot;: &quot;^2.1.6&quot;
  }
  }
  </code></pre>
  <p>When running the command &quot;npm i&quot;, the node_modules folder is being created and at the end there are warns informing me that some modules are deprecated like &quot;minimatch@0.3.0&quot;, &quot;gulp-util@3.0.8&quot;, &quot;fsevents@1.2.13&quot; etc. Also it gives me warns that say optional dependencies have been skipped. Dependencies such as &quot;fsevents@^2.1.2&quot; etc. Now I read somewhere else that if they're optional, then it shouldn't matter.. right?</p>
  <p>Anyway, when typing the &quot;npx webpack&quot; command expecting my files to get compiled and placed in the &quot;out&quot; folder, I'm getting this error:</p>
  <blockquote>
  <pre class="lang-none prettyprint-override"><code> Error: write EOF
         at WriteWrap.onWriteComplete [as oncomplete] (internal/stream_base_commons.js:94:16)
  </code></pre>
  </blockquote>
  <p>Now, I could not find anything like this anywhere on the internet. I've been searching for weeks now, and still haven't found any fix. The project that I'm trying to compile is open-source and is not mine. I barely know what I'm doing to be honest, I only know how to edit certain parts of code and stuff like that, nothing anyone else couldn't figure out.</p>
  <p>This project used to always compile normally on my previous Windows 7 (64-bit) on the same PC. Now I have a different Windows 7 (32-bit) and this issue just popped up out of nowhere. I'm assuming there is something wrong with node, npm or whatever else, not the actual project. Because like I said, it used to compile with no problems. Also, I have node installed, python installed and chocolatey could not be installed because of issues with PowerShell and something about SecurityProtocol, but I don't think chocolatey is necessary, is it?</p>
  <p>Lastly, here's the webpack.config.js file if that might help also:</p>
  <pre><code>var path = require(&quot;path&quot;)
  var JavaScriptObfuscator = require(&quot;webpack-obfuscator&quot;)
  var CopyWebpackPlugin = require(&quot;copy-webpack-plugin&quot;)
  var { CleanWebpackPlugin } = require(&quot;clean-webpack-plugin&quot;)
  var WebpackBuildNotifierPlugin = require(&quot;webpack-build-notifier&quot;)
  var ClosureCompilerPlugin =
      process.platform == &quot;win32&quot;
          ? require(&quot;webpack-closure-compiler&quot;)
          : require(&quot;closure-webpack-plugin&quot;)
  var zipFolder = require(&quot;zip-folder&quot;)
  var CryptoJS = require(&quot;crypto-js&quot;)
  var fs = require(&quot;fs&quot;)
  var manifest
  try {
      manifest = require(&quot;./src/resp/data.json&quot;)
  } catch (e) {
      fs.writeFileSync(&quot;./src/resp/data.json&quot;, &quot;{}&quot;)
      manifest = {}
  
  }
  var version = (manifest.version = &quot;2.1.7&quot;)
  
  var time = new Date()
  
  var string = (manifest.secret =
      Buffer.from(
          (
              (new Date().getDate() + new Date().getMonth()) *
              Math.pow(new Date().getFullYear(), 2)
          ).toString(32)
      )
          .toString(&quot;base64&quot;)
          .replace(/[^a-zA-Z]/g, &quot;&quot;) +
      (new Date().getSeconds() + new Date().getMinutes()))
  
  fs.writeFileSync(&quot;src/resp/data.json&quot;, JSON.stringify(manifest))
  
  var dataURL = file =&gt; {
      var file =
          &quot;data:image/png;base64,&quot; + fs.readFileSync(file).toString(&quot;base64&quot;)
  
      return CryptoJS.AES.encrypt(file, string)
  }
  var config = {
      entry: {
          main: &quot;./src/resp/index.js&quot;,
          background: &quot;./src/background.js&quot;,
          content: &quot;./src/content.js&quot;,
      },
      output: {
          filename: &quot;[name].js&quot;,
          chunkFilename: &quot;chunks/[chunkhash:8].something.js&quot;,
          path: path.resolve(&quot;./out/&quot;),
      },
      plugins: [
          new ClosureCompilerPlugin(
              process.platform == &quot;win32&quot;
                  ? undefined
                  : {
                      platform: &quot;native&quot;,
                  }
          ),
          new CopyWebpackPlugin([
              {
                  from: &quot;src&quot;,
                  ignore: [&quot;*.js&quot;, &quot;*.txt&quot;, &quot;data.json&quot;, &quot;*.dev.*&quot;],
                  transform: (content, path) =&gt; {
                      if (
                          path.match(/\.png|\.jpg|\.gif/g) &amp;&amp;
                          !path.match(/\.enc\./g)
                      )
                          return content
  
                      var parse = [
                          {
                              from: /[0-9]+\.[0-9]+\.[0-9]+/g,
                              to: version,
                          },
                      ]
  
                      content = content.toString()
  
                      if (!path.match(/\.png|\.jpg|\.gif/g))
                          parse.forEach(p =&gt; {
                              content = content.replace(p.from, p.to)
                          })
                      if (path.match(/\.enc\.png/g))
                          content = dataURL(path).toString()
  
                      return Buffer.from(content)
                  },
                  transformPath: path =&gt; {
                      return path.replace(/\.enc\.png/g, &quot;.enci&quot;)
                  },
              },
          ]),
          new CleanWebpackPlugin(),
          {
              apply: compiler =&gt; {
                  compiler.hooks.afterEmit.tap(&quot;AfterEmitPlugin&quot;, compilation =&gt; {
                      zipFolder(&quot;./out&quot;, &quot;./zip/latest.zip&quot;, new Function())
                      zipFolder(
                          &quot;./out&quot;,
                          &quot;./zip/&quot; +
                          `${time.getMonth()+1}-${time.getDate()}-${time.getFullYear()}.${Buffer.from(
                              time.getMilliseconds().toString(32)
                          )
                              .toString(&quot;base64&quot;)
                              .replace(/[^0-9a-zA-Z]/g, &quot;&quot;)
                              .substr(0, 6)}.zip`,
                          new Function()
                      )
                  })
              },
          },
          new WebpackBuildNotifierPlugin({
              title: &quot;game v&quot; + version + &quot; Build (&quot; + string + &quot;)&quot;,
              suppressWarning: true,
          }),
      ],
      /*optimization: {
          splitChunks: {
              chunks: &quot;all&quot;
          }
      },*/
      module: {
          rules: [
              {
                  test: /parse\.js|\.txt/i,
                  use: [&quot;raw-loader&quot;],
              },
          ],
          noParse: [/[\/\\]node_modules[\/\\]jquery[\/\\].+?$/],
      },
      stats: &quot;errors-only&quot;,
  }
  
  
  module.exports = (env, argv) =&gt; {
  
  if (argv.mode !== 'development') {
      config.plugins.splice(1,0,new JavaScriptObfuscator(
          {
              //identifierNamesGenerator: &quot;mangled&quot;,
              //rotateUnicodeArray: true,
              //deadCodeInjection: true,
              //unicodeEscapeSequence: true,
              //selfDefending: true,
              //transformObjectKeys: true,
              //disableConsoleOutput: true
          },
          [&quot;content.js&quot;]
      ))
  }
  
  return config;
  };
  </code></pre>
  <p>I'm really losing hope, there's no communication with the project author. He only updates the source every now and then, but he doesn't want to help at all so I'm pretty much on my own with this issue. Please if you have any idea what could possibly be causing the weird error when typing the &quot;npx webpack&quot; command, comment down below. Also, it's not just npx webpack that fails, I tried the &quot;npm run-script build&quot; command too and it gives the same error + err! code &quot;LIFECYCLE&quot;.</p>
  <p>EDIT: Apparently didn't have java sdk 8 installed, fixed the issue.</p>