Mix throws error Laravel 8
See original GitHub issueLaravel Version: 8.12 PHP Version: 8.0.1 NodeJS Version: 15.5.1 npm Version: 6.14.11
Description:
Found this problem when doing npm run dev
:
node:internal/modules/cjs/loader:928
throw err;
^
Error: Cannot find module 'F:\Himmlisch\Desarrollo'
Require stack:
- F:\Himmlisch\Desarrollo Indie\HTML\Webpages\Mine\freeCodeGram\node_modules\webpack\bin\convert-argv.js
- F:\Himmlisch\Desarrollo Indie\HTML\Webpages\Mine\freeCodeGram\node_modules\webpack\bin\webpack.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:925:15)
at Function.Module._load (node:internal/modules/cjs/loader:769:27)
at Module.require (node:internal/modules/cjs/loader:997:19)
at require (node:internal/modules/cjs/helpers:92:18)
at requireConfig (F:\Himmlisch\Desarrollo Indie\HTML\Webpages\Mine\freeCodeGram\node_modules\webpack\bin\convert-argv.js:97:18)
at F:\Himmlisch\Desarrollo Indie\HTML\Webpages\Mine\freeCodeGram\node_modules\webpack\bin\convert-argv.js:104:17
at Array.forEach (<anonymous>)
at module.exports (F:\Himmlisch\Desarrollo Indie\HTML\Webpages\Mine\freeCodeGram\node_modules\webpack\bin\convert-argv.js:102:15)
at Object.<anonymous> (F:\Himmlisch\Desarrollo Indie\HTML\Webpages\Mine\freeCodeGram\node_modules\webpack\bin\webpack.js:155:40)
at Module._compile (node:internal/modules/cjs/loader:1108:14) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'F:\\Himmlisch\\Desarrollo Indie\\HTML\\Webpages\\Mine\\freeCodeGram\\node_modules\\webpack\\bin\\convert-argv.js',
'F:\\Himmlisch\\Desarrollo Indie\\HTML\\Webpages\\Mine\\freeCodeGram\\node_modules\\webpack\\bin\\webpack.js'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `mix`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Luan\AppData\Local\npm-cache\_logs\2021-01-12T18_28_52_032Z-debug.log
npm ERR! code 1
npm ERR! path F:\Himmlisch\Desarrollo Indie\HTML\Webpages\Mine\freeCodeGram
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c npm run development
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Luan\AppData\Local\npm-cache\_logs\2021-01-12T18_28_52_490Z-debug.log
Process finished with exit code 1
It looks like an error related to a relative path or something like that.
I removed node_modules like 5 times at this time so, no, that ain’t it. Also installed weird packages that people recommended to solve this problem and also nothing.
Log file:
0 verbose cli [
0 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
0 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
0 verbose cli 'run',
0 verbose cli 'dev',
0 verbose cli '--scripts-prepend-node-path=auto'
0 verbose cli ]
1 info using npm@7.3.0
2 info using node@v15.5.1
3 timing config:load:defaults Completed in 8ms
4 timing config:load:file:C:\Program Files\nodejs\node_modules\npm\npmrc Completed in 222ms
5 timing config:load:builtin Completed in 222ms
6 timing config:load:cli Completed in 40ms
7 timing config:load:env Completed in 5ms
8 timing config:load:file:F:\Himmlisch\Desarrollo Indie\HTML\Webpages\Mine\freeCodeGram\.npmrc Completed in 57ms
9 timing config:load:project Completed in 264ms
10 timing config:load:file:C:\Users\Luan\.npmrc Completed in 95ms
11 timing config:load:user Completed in 96ms
12 timing config:load:file:C:\Users\Luan\AppData\Roaming\npm\etc\npmrc Completed in 64ms
13 timing config:load:global Completed in 65ms
14 timing config:load:cafile Completed in 1ms
15 timing config:load:validate Completed in 9ms
16 timing config:load:setUserAgent Completed in 2ms
17 timing config:load:setEnvs Completed in 3ms
18 timing config:load Completed in 716ms
19 verbose npm-session 455f228c72b5e6a2
20 timing npm:load Completed in 1262ms
21 timing command:run-script Completed in 132652ms
22 verbose stack Error: command failed
22 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\@npmcli\promise-spawn\index.js:64:27)
22 verbose stack at ChildProcess.emit (node:events:376:20)
22 verbose stack at maybeClose (node:internal/child_process:1063:16)
22 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:295:5)
23 verbose cwd F:\Himmlisch\Desarrollo Indie\HTML\Webpages\Mine\freeCodeGram
24 verbose Windows_NT 10.0.18363
25 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev" "--scripts-prepend-node-path=auto"
26 verbose node v15.5.1
27 verbose npm v7.3.0
28 error code 1
29 error path F:\Himmlisch\Desarrollo Indie\HTML\Webpages\Mine\freeCodeGram
30 error command failed
31 error command C:\Windows\system32\cmd.exe /d /s /c npm run development
32 verbose exit 1
Steps To Reproduce:
Simply run npm run dev
on a freshly created Laravel project
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Mix throws error Laravel 8 · Issue #2774 - GitHub
It looks like an error related to a relative path or something like that. I removed node_modules like 5 times at this time...
Read more >Error Handling - Laravel - The PHP Framework For Web Artisans
The App\Exceptions\Handler class is where all exceptions thrown by your application are logged and then rendered to the user. We'll dive deeper into...
Read more >How To Fix “Laravel Mix NPM run dev error” - YouTube
This video will help you to solve the annoying “ Laravel Mix NPM run dev error ” that you probably have seen before...
Read more >laravel 8 instalation error - npm run dev throws error
I am trying to install a fresh laravel 8 project. After downloading frontend scaffolding when I try to run npm run dev it...
Read more >Laravel 8 with React fails at command npm run dev - Laracasts
I keep getting this no matter what I try in Laravel 8.20.1 and Node 12.6.0 on command npm run dev. I'm trying to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@LuanHimmlisch we tagged a release earlier that should work around the problem with spaces in paths on Windows.
Seeing your above error through I recommend removing
node_modules
and your lock file and re-installing. That is an error in mini-css-extract-plugin but it seems like a wrong version of webpack may have gotten installed.Finally, thanks