Can you post you package.json file ?
Dec 2, 2020
13
Level 8
"npm run prod" returns : Error Cannot find module webpack.mix
Hello,
I try npm run prod but it's not working !
Error: Cannot find module '/data/www/(...).com/webpack.mix'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (/data/www/(...).com/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
at Object.<anonymous> (/data/www/(...).com/node_modules/laravel-mix/setup/webpack.config.js:12:1)
at Module._compile (/data/www/(...).com/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (/data/www/(...).com/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
at WEBPACK_OPTIONS (/data/www/(...).com/node_modules/webpack-cli/bin/utils/convert-argv.js:114:13)
at requireConfig (/data/www/(...).com/node_modules/webpack-cli/bin/utils/convert-argv.js:116:6)
at /data/www/(...).com/node_modules/webpack-cli/bin/utils/convert-argv.js:123:17
at Array.forEach (<anonymous>)
at module.exports (/data/www/(...).com/node_modules/webpack-cli/bin/utils/convert-argv.js:121:15)
at yargs.parse (/data/www/(...).com/node_modules/webpack-cli/bin/cli.js:71:45)
at Object.parse (/data/www/(...).com/node_modules/webpack-cli/node_modules/yargs/yargs.js:576:18)
at /data/www/(...).com/node_modules/webpack-cli/bin/cli.js:49:8
at Object.<anonymous> (/data/www/(...).com/node_modules/webpack-cli/bin/cli.js:366:3)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at runCli (/data/www/(...).com/node_modules/webpack/bin/webpack.js:54:2)
at Object.<anonymous> (/data/www/(...).com/node_modules/webpack/bin/webpack.js:147:2)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
I deleted the node_modules then npm install but always the same error.
Level 102
Remove webpack.mix.js from the gitignore file :) It should be in gits control
Then try running git add webpack.mix.jsand then git status. If it has picked up the file, you can commit, push, pull and try again :)
Please or to participate in this conversation.