ReactJS Webpack Module build failed: Error: Cannot find module
Running the npm start in reactjs by using nodejs, its throwing error like "Module build failed: Error: Cannot find module".
Solution:
Actually when running the script that time corresponding module is not available. For this excute below commands, that is issue will be resolved.
1. To find the webpack errors
Run your webpack with display-error-details option to enable more debugging on the errors.
2. Run below Commands in your command promt
3. Set your Environment variable
For Windows:
4. Check Module Folder
Sometimes our installed available in our user appdata folders also. So that goto
Example :
I am executing my reactjs npm module in
Running the npm start in reactjs by using nodejs, its throwing error like "Module build failed: Error: Cannot find module".
Module build failed: Error: Cannot find module 'locate-path'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (F:\php\htdocs\reactjs\node_modules\pkg-dir\node_modul
es\find-up\index.js:3:20)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-serve
r ./main.js
webpack: Failed to compile.
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (F:\php\htdocs\reactjs\node_modules\pkg-dir\node_modul
es\find-up\index.js:3:20)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
@ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-serve
r ./main.js
webpack: Failed to compile.
Solution:
Actually when running the script that time corresponding module is not available. For this excute below commands, that is issue will be resolved.
1. To find the webpack errors
Run your webpack with display-error-details option to enable more debugging on the errors.
webpack --progress --color --watch --display-error-details
2. Run below Commands in your command promt
npm list -g
npm install --global [Your Missing Module Name]
npm install --global locate-path
npm install wisp --save
npm install --global --verbose promised-io
npm install --global [Your Missing Module Name]
npm install --global locate-path
npm install wisp --save
npm install --global --verbose promised-io
3. Set your Environment variable
For Windows:
set NODE_PATH=C:\Users\codingslover\AppData\Roaming\npm\node_modules
4. Check Module Folder
Sometimes our installed available in our user appdata folders also. So that goto
C:\Users\codingslover\AppData\Roaming\npm\node_modules
folder, find the missing modules and copy the module and place into your execution folder.Example :
I am executing my reactjs npm module in
F:php/htdocs/reacttest/
, inside module folder need to check module availability.
This comment has been removed by a blog administrator.
ReplyDeleteBest article, very useful and explanation. Your post is extremely incredible. Thank you very much for the new information.
ReplyDeletereactjs development company Frisco
reactjs development company in Frisco
Hire reactjs Developer Frisco Texas USA
Hire reactjs Developers in Frisco Texas USA
React JS Development Company in Austin
reactjs development company Texas
reactjs development company in Texas
reactjs development company USA
reactjs development company in USA
best react companies
react js development companies
companies using reactjs
reactjs development company
pusulabet
ReplyDeletesex hattı
https://izmirkizlari.com
rulet siteleri
rexbet
FTDC7Q