**I got error while webpack**
error is :
webpack
internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module 'resolve-cwd'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/usr/share/nodejs/webpack/node_modules/import-local/index.js:3:20)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
please help me to resolved this problem. I tried this one npm install resolve-cwd . still i am getting same issues after type webpack.i also delete node_module folder and package_json_lock file and npm install .after this run webpack still got same above error .
node --version
v10.19.0
npm --version
7.10.0
I'm not entirely sure why this happened. But I can speculate that it is due to old webpack version.
I've faced this issue right now. I had installed webpack using apt (on Ubuntu 20.04.2 (Focal Fossa)).
Reinstalling webpack using npm resolved the issue.
Steps I followed:
$ rm $(which webpack); # removes the currently installed webpack
# you can replace $(which webpack) with the webpack location
$ npm i -g webpack webpack-cli
I had the same issue with Resolve-CwD. But in my case it was caused by yarn not installing webpack properly.
You have an older version of node so try updating it and see if the above steps are working.
If it's not working then i'd say you try an older version of Ruby until the current issue with har-validator is sorted
In my case the error was caused because yarn was using har-validatior which is deprecated and just couldn't install webpack completely
Despite installing the missing module 'resolve-cwd' it kept failing with another missing module.
I had to delete the node_modules folder then re-running the npm install command to install dependencies. This worked for me