Error: Cannot find module 'webpack/lib/removeAndDo' at Function.Module._resolveFilename (module.js:470:15)

Rschary picture Rschary · Sep 6, 2018 · Viewed 7.5k times · Source

When ever I try to perform npm install to build my react part in project. it throws the error below:

*module.js:472
    throw err;
    ^
Error: Cannot find module 'webpack/lib/removeAndDo'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\CHUBB\Sourcecode_claimyno_svn\denuncia-claimy\src\main\webapp\js\appReact\node_modules\extract-text-webpack-plugin\ExtractedModule.js:30:42)*

What is the issue with my react part and what could be a possible solution.

Answer

Praveen Rao Chavan.G picture Praveen Rao Chavan.G · Sep 6, 2018

You have to cleaned npm cache:

$ rm -rf node_modules/
$ npm cache clean --force
$ npm i