Ask questionsModule not found: Error: Can't resolve 'child_process'

Hi. I am building my project with webpack@4.31.0 and I am getting the following error. As it looks on, child_process is not in use. Is there any chance that it could be fixed here?

This package name is not currently in use, but was formerly occupied by another package. To avoid malicious use, npm is hanging on to the package name, but loosely, and we'll probably give it to you if you want it.

Error I am getting is:

ERROR in ./node_modules/worker-farm/lib/fork.js
Module not found: Error: Can't resolve 'child_process' in 'C:\Programming\Keia-AOT\node_modules\worker-farm\lib'
 @ ./node_modules/worker-farm/lib/fork.js 3:21-45
 @ ./node_modules/worker-farm/lib/farm.js
 @ ./node_modules/worker-farm/lib/index.js
 @ ./node_modules/terser-webpack-plugin/dist/TaskRunner.js
 @ ./node_modules/terser-webpack-plugin/dist/index.js
 @ ./node_modules/terser-webpack-plugin/dist/cjs.js
 @ (webpack)/lib/WebpackOptionsDefaulter.js
 @ (webpack)/lib/webpack.js
 @ ./config/webpack.server.js

Answer questions levz0r

Hey. Sorry for the wait time. Here is a demo repo for you. To reproduce:

  1. Run npm init
  2. Run webpack in main dir.
  3. Go to dist and run node index.bundle.js Boom

Related questions

No questions were found.
Github User Rank List