Closed Altimetrik-venkateshp closed 2 years ago
For me issue was fixed after I removed @webpack-cli
from package.json
, ran yarn
to update dependencies and then ran yarn start
- it asked me to install cli again and successfully served site after that.
C:\projects\webpack5-react-typescript>yarn start yarn run v1.22.15 $ cross-env WEBPACK_IS_DEV_SERVER=true NODE_ENV=development webpack serve --config webpack.config.babel.js [webpack-cli] Unable to load '@webpack-cli/serve' command [webpack-cli] TypeError: options.forEach is not a function at WebpackCLI.makeCommand (C:\projects\webpack5-react-typescript\node_modules\webpack-cli\lib\webpack-cli.js:108:21) at ServeCommand.apply (C:\projects\webpack5-react-typescript\node_modules\@webpack-cli\serve\lib\index.js:41:19) at loadCommandByName (C:\projects\webpack5-react-typescript\node_modules\webpack-cli\lib\webpack-cli.js:626:35) at Command. (C:\projects\webpack5-react-typescript\node_modules\webpack-cli\lib\webpack-cli.js:1091:23)
at Command.listener [as _actionHandler] (C:\projects\webpack5-react-typescript\node_modules\webpack-cli\node_modules\commander\index.js:922:31)
at Command._parseCommand (C:\projects\webpack5-react-typescript\node_modules\webpack-cli\node_modules\commander\index.js:1503:14)
at Command.parse (C:\projects\webpack5-react-typescript\node_modules\webpack-cli\node_modules\commander\index.js:1292:10)
at Command.parseAsync (C:\projects\webpack5-react-typescript\node_modules\webpack-cli\node_modules\commander\index.js:1318:10)
at WebpackCLI.run (C:\projects\webpack5-react-typescript\node_modules\webpack-cli\lib\webpack-cli.js:1123:28)
at runCLI (C:\projects\webpack5-react-typescript\node_modules\webpack-cli\lib\bootstrap.js:11:19)
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.