Error: Cannot find module 'webpack/lib/node/NodeTemplatePlugin'
See original GitHub issueIs this a bug report?
YES (write your answer here)
Did you try recovering your dependencies?
5.8.0 (Write your answer here.)
Which terms did you search for in User Guide?
Error: Cannot find module (Write your answer here if relevant.)
Environment
node -v
: v8.9.4npm -v
: 5.8.0yarn --version
(if you use Yarn):npm ls react-scripts
(if you haven’t ejected):
Then, specify:
- Operating system: 7.4.0 Darwin Kernel Version 17.4.0 AND Ubuntu 16.04
- Browser and version (if relevant):
Steps to Reproduce
upgrade react-scripts from 1.0.11 to 1.1.1 and node from v7.4.0 to v8.9.4.
simply upgrading react-scripts from 1.0.11 to 1.1.1 works with v7.4.0, build fails with v8.9.4 (Write your steps here:)
- update package.json to react-scripts 1.1.1
- bash$ n 8.9.4
- bash$ rm -rf node_modes && npm i
- bash$ npm run build
Expected Behavior
Expected to build to work as when running with npm run build
with node v7.4.0.
(Write what you thought would happen.)
Actual Behavior
> REACT_APP_ENV=production react-scripts build
module.js:540
throw err;
^
Error: Cannot find module 'webpack/lib/node/NodeTemplatePlugin'
at Function.Module._resolveFilename (module.js:538:15)
at Function.Module._load (module.js:468:25)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/Barry/projects/e/node_modules/html-webpack-plugin/lib/compiler.js:11:26)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/Barry/projects/e/node_modules/html-webpack-plugin/index.js:7:21)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! e@0.1.0 build: `REACT_APP_ENV=production react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the e@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
(Write what happened. Please add screenshots!)
Reproducible Demo
(Paste the link to an example project and exact instructions to reproduce the issue.)
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (4 by maintainers)
Top Results From Across the Web
Cannot find module 'webpack/lib/node/NodeTemplatePlugin ...
This error occurs only when webpack doesn't exist locally, so if your package.json has webpack mentioned in its devDependencies —this should do ...
Read more >Error: Cannot find module 'webpack/lib/node ... - GitHub
Hi, I get the same error after running webpack command:: module.js:341 - I have node v5.6.0 - working on the React.js program, as...
Read more >Error Cannot find module webpack lib node ... - Edureka
Got this Error after running webpack. Webpack is installed globally and I'm running Node PS D:\Projects .
Read more >How to fix Error: cannot find module "webpack" - Educative.io
The Cannot find module webpack occurs when webpack is not globally installed. It is a problem with the npm script or application. You...
Read more >[SOLVED] Error Cannot find module 'webpack/lib ... - YouTube
Hello guys today's video, i'm going to show you how to fix the " Error : Cannot find module ' webpack / lib...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Upgrading to 1.1.2 fixed this issue. Thank you.
Yes, this issue occurs with 1.1.4 but fix with 1.1.2.