Trusted answers to developer questions

How to fix Error: cannot find module "webpack"

Free System Design Interview Course

Many candidates are rejected or down-leveled due to poor performance in their System Design Interview. Stand out in System Design Interviews and get hired in 2024 with this popular free course.

The Cannot find module webpack occurs when webpack is not globally installed. It is a problem with the npm script or application. You can try the following to combat the issue:

Solution

1. Install webpack in the local app folder

Ensure that you have installed the latest version of the webpack by running:

npm install webpack

2. Link webpack to your project

If the above solution does not work, try linking a globally installed webpack to your project. In your project, open the terminal, and type:

npm link webpack

RELATED TAGS

javascript

CONTRIBUTOR

Sarvech Qadir
Copyright ©2024 Educative, Inc. All rights reserved
Did you find this helpful?