I looked at and executed almost every single answer on this post: The CLI moved into a separate package: webpack-cli It has not helped.
Allow me to present my case:
So I have developed a container folder, a separate application where I ran npm init -y
and then installed the following:
npm install html-webpack-plugin@4.5.0 nodemon webpack@5.3.2 webpack-cli@4.1.0 webpack-dev-server@3.11.0
Then I went into my package.json
file and added the start script:
{
"name": "container",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "webpack serve"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"html-webpack-plugin": "^4.5.0",
"nodemon": "^2.0.6",
"webpack": "^5.3.2",
"webpack-cli": "^4.1.0",
"webpack-dev-server": "^3.11.0"
}
}
When I go to terminal and run npm start
, this is why I get every single time:
➜ container npm start
> container@1.0.0 start /Users/luiscortes/Projects/ecommRS/container
> webpack serve
[webpack-cli] The command moved into a separate package: @webpack-cli/serve
? Would you like to install @webpack-cli/serve? (That will run npm install -D @webpack-cli/serve) (Y/n) › true
And yes even if I choose Y
or true
and it runs its npm install -D @webpack-cli/serve
, when I go back to running npm start
it just gives me the same error over and over again.