Cannot find module 'webpack' on fresh installation
See original GitHub issueI have a fresh installation of NX for React project; I got this message when try to serve the React project from VSCode NX toolkit.
> Executing task: nx serve fe-ui-compoents <
> nx run fe-ui-compoents:serve
Cannot find module 'webpack'
Require stack:
- /Users/nv/projects/x/y/node_modules/webpack-dev-server/lib/Server.js
- /Users/nv/projects/x/y/node_modules/@nrwl/web/src/executors/dev-server/dev-server.impl.js
- /Users/nv/projects/x/y/node_modules/@nrwl/tao/src/shared/workspace.js
- /Users/nv/projects/x/y/node_modules/@nrwl/tao/src/commands/run.js
- /Users/nv/projects/x/y/node_modules/@nrwl/tao/index.js
- /Users/nv/projects/x/y/node_modules/@nrwl/cli/lib/run-cli.js
βββββββββββββββββββββββββββββββββββββββββββββββ
> NX ERROR Running target "fe-ui-compoents:serve" failed
Failed tasks:
- fe-ui-compoents:serve
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:29 (2 by maintainers)
Top Results From Across the Web
node.js - Error: Cannot find module 'webpack' - Stack Overflow
Error: Cannot find module 'webpack' is a node error. So this has nothing to do with webpack itself (afaict). It seems like node...
Read more >How to fix Error: cannot find module "webpack" - Educative.io
1. Install webpack in the local app folder Β· 2. Link webpack to your project.
Read more >Cannot find module 'webpack-cli' error | bobbyhadz
To solve the "Cannot find module 'webpack-cli'" error, make sure to install webpack-cli globally by running the npm i -g webpack-cli command and...
Read more >Fix Global Installs Not Working | "Cannot find module" error FIX
Getting " Cannot find module " after installing something globally (with -g)? Well, this video shows you how to fix global package/ module...
Read more >MikysIta - Netlify Support Forums
Dependencies installation error. Cannot find module 'β¦/webpack-runtime.js'. Before this error I had a similar one that could not find theΒ ...
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 Free
Top 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
Same problem here after a fresh installation, using angular project, solved with:
I faced the same problem with
npx create-nx-workspace
-> preset: emptynpm i --save-dev @nrwl/angular
npx nx g @nrwl/angular:application
-> name: appnpx nx run app:build
Installed nx version is 13.3.1
Resulting in
Resolved the build and serve target issue by installing webpack manually: