Error: spawn C:\..\node_modules\esbuild\esbuild.exe ENOENT
See original GitHub issueDescribe the bug
npm run build error
System Info
vite
version: 2.0.0-beta.5- Operating System: Windows 10
- Node version: v15.5.1
- Optional:
- npm version: 7.0.9
Logs (Optional if provided reproduction)
$ npm run build --debug
> admin@0.0.0 build
> vite build && mv ../public/_admin/index.html ../resources/views/admin.blade.php
building for production...
node:events:353
throw er; // Unhandled 'error' event
^
Error: spawn C:\Users\Administrator\code\lykee\admin\node_modules\esbuild\esbuild.exe ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:276:19)
at onErrorNT (node:internal/child_process:476:16)
at processTicksAndRejections (node:internal/process/task_queues:80:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (node:internal/child_process:282:12)
at onErrorNT (node:internal/child_process:476:16)
at processTicksAndRejections (node:internal/process/task_queues:80:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn C:\\Users\\Administrator\\code\\lykee\\admin\\node_modules\\esbuild\\esbuild.exe',
path: 'C:\\Users\\Administrator\\code\\lykee\\admin\\node_modules\\esbuild\\esbuild.exe',
spawnargs: [ '--service=0.8.29' ]
}
npm ERR! code 1
npm ERR! path C:\Users\Administrator\code\lykee\admin
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c "vite build && mv ../public/_admin/index.html ../resources/views/admin.blade.php"
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Local\npm-cache\_logs\2021-01-05T06_28_01_397Z-debug.log
Issue Analytics
- State:
- Created 3 years ago
- Comments:17 (2 by maintainers)
Top Results From Across the Web
Error: spawn C:\Program ENOENT (Cannot build ... - GitHub
Nope, I am using the cmd.exe. Also I am tried these consoles: Cmd, Powershell, Windows Terminal.
Read more >How do I debug "Error: spawn ENOENT" on node.js?
Tried all nothing worked , my system has different issue . The working solution for me is run command : npm config set...
Read more >Build error MSBuild.exe ENOENT with new node version
Here is the error from build. gyp ERR! stack Error: spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\15.0\Bin\ ...
Read more >ended with error spawn cmd.exe ENOENT - YouTube
ended with error spawn cmd. exe ENOENT (salesforce) ... to Install and Set Visual Studio Code and MinGW Compiler for C and C++...
Read more >Error: spawn openocd.exe ENOENT" I was wondering ... - Reddit
I got an error in Vscode when I want to debug "Failed to launch OpenOCD GDB Server: Error: spawn openocd.exe ENOENT" I was...
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
I know how to fix it. Run:
node ./node_modules/esbuild/install.js
. This should be written inpackage.json
, but the custompackage.json
does not have this sentence, so you can run it manually.It turns out npm v7 has a bug that corrupts
package-lock.json
files: https://github.com/npm/cli/issues/2606. When this happens, packages like esbuild with post install scripts can break. You may be experiencing this bug. A workaround is to delete and recreate yourpackage-lock.json
file.