Edwin Castro
Edwin Castro

Reputation: 1

Need to install 'webpack-dev-server'

I have cloned a repo from GitHub for a project. I've already installed node (-v 14.17.5) and npm (-v7.20.6), however when I run npm start I get the following code. I've tried reinstalling node and npm several times but I keep getting the same error:

$ npm start

> [email protected] start
> webpack server --config webpack.dev.js --open

[webpack-cli] You need to install 'webpack-dev-server' for running 'webpack serve'.
Error: Cannot find module 'webpack-dev-server/bin/cli-flags'
Require stack:
- C:\Users\edwin\Desktop\git\simplefolio\node_modules\@webpack-cli\serve\lib\index.js
- C:\Users\edwin\Desktop\git\simplefolio\node_modules\webpack-cli\lib\webpack-cli.js
- C:\Users\edwin\Desktop\git\simplefolio\node_modules\webpack-cli\lib\bootstrap.js
- C:\Users\edwin\Desktop\git\simplefolio\node_modules\webpack-cli\bin\cli.js
- C:\Users\edwin\Desktop\git\simplefolio\node_modules\webpack\bin\webpack.js

Upvotes: 0

Views: 5640

Answers (3)

user19048898
user19048898

Reputation: 51

Remove node_modules and package-lock.json, then npm i again

Upvotes: 2

Tng
Tng

Reputation: 614

In my case, I have node 16.13.0 and npm 7.20.1. Removing nodes_modules, package-lock.json and run npm cache clean --force alone didn't help. The key change for me is upgrading npm version to the latest (8.7.0), then combining with clean install.

Upvotes: 0

user17664688
user17664688

Reputation: 1

Remove node modules, then npm i again

Upvotes: 0

Related Questions