1

lam getting the error below while running npm run dev

[webpack-cli] TypeError: this.program.configureOutput is not a function at new WebpackCLI (/home/vagrant/sites/ecom/node_modules/webpack-cli/lib/webpack-cli.js:19:22) at runCLI (/home/vagrant/sites/ecom/node_modules/webpack-cli/lib/bootstrap.js:7:21) at Object. (/home/vagrant/sites/ecom/node_modules/webpack-cli/bin/cli.js:23:5) at Module._compile (node:internal/modules/cjs/loader:1092:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10) at Module.load (node:internal/modules/cjs/loader:972:32) at Function.Module._load (node:internal/modules/cjs/loader:813:14) at Module.require (node:internal/modules/cjs/loader:996:19) at require (node:internal/modules/cjs/helpers:92:18) at runCli (/home/vagrant/sites/ecom/node_modules/webpack/bin/webpack.js:54:2) npm ERR! code 2 npm ERR! path /home/vagrant/sites/ecom npm ERR! command failed npm ERR! command sh -c mix

npm ERR! A complete log of this run can be found in: npm ERR! /home/vagrant/.npm/_logs/2021-03-19T11_14_07_947Z-debug.log npm ERR! code 2 npm ERR! path /home/vagrant/sites/ecom npm ERR! command failed npm ERR! command sh -c npm run development

npm ERR! A complete log of this run can be found in: npm ERR! /home/vagrant/.npm/_logs/2021-03-19T11_14_07_974Z-debug.log

2

2 Answers 2

1

First, try to update your node.js file and then run "npm run dev" and if you again faced the same problem follow the following steps:

Step1: composer update
Step2: rm -rf node_modules
Step3: npm cache clear --force
Step4: npm install
Step5: npm outdated
In this step, it will update your laravel-mix version, it is in the package.json.
Step6: npm install
Step7: npm run dev

After all these steps, everything is good. I hope it solve your problem.

Sign up to request clarification or add additional context in comments.

1 Comment

It's better that way: npm cache clear --force
0

I came across this problem when trying to build and run webpack (and webpack-cli locally), after check out from Github (not at all related to Laravel).

I found that I forgot to run yarn install for webpack-cli which lead to the issue that an existing version of commander@6 was used, but webpack-cli requires commander@7.

npm list commander should tell you that the webpack-cli dependency is unsatisfied. yarn install should fix it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.