0

I'd like to uninstall webpack 4.44.1. The SO post here on this did not work for me. When I run:

> npm uninstall -g webpack@4.44.1
up to date in 0.134s

and then when I run:

npm list -g webpack@4.44.1

it shows:

C:\Users\me\AppData\Roaming\npm
`-- (empty)

But, when I run:

npm ls

It gives me:

+-- moment@2.27.0
+-- webpack@4.44.1
| +-- @webassemblyjs/ast@1.9.0
| | +-- @webassemblyjs/helper-module-context@1.9.0 deduped
| | +-- @webassemblyjs/helper-wasm-bytecode@1.9.0
| | `-- @webassemblyjs/wast-parser@1.9.0
| |   +-- @webassemblyjs/ast@1.9.0 deduped
| |   +-- @webassemblyjs/floating-point-hex-parser@1.9.0
| |   +-- @webassemblyjs/helper-api-error@1.9.0 deduped
| |   +-- @webassemblyjs/helper-code-frame@1.9.0
| |   | `-- @webassemblyjs/wast-printer@1.9.0 deduped
| |   +-- @webassemblyjs/helper-fsm@1.9.0
| |   ... (for brevity, I am not including the rest)

So, my question is why is the webpack 4.44.1 shows up again and how to effectively uninstall it?

EarlyCoder
  • 1,213
  • 2
  • 18
  • 42

2 Answers2

1

Try running npm uninstall -g webpack --save npm uninstall webpack --save

Run the two lines of code above

Dharman
  • 30,962
  • 25
  • 85
  • 135
  • It kind of worked. The webpack was uninstalled, but npm complains that ```npm ERR! peer dep missing: webpack@4.x.x, required by webpack-cli@3.3.12``` So, how do I uninstall webpack-cli? – EarlyCoder Oct 20 '20 at 14:23
0

ok install this npm module npm i -D webpack-cli @webpack-cli/remove go to the current project you are having problems with and run this command

const remove = require("@webpack-cli/remove").default;

remove();

or via terminal

npx webpack-cli remove

try that and see how it goes