vite搭建项目提示Error: spawn F:\vue\demo2\node_modules\esbuild\esbuild.exe ENOENT errno: -4058,

node:events:371
      throw er; // Unhandled 'error' event
      ^

Error: spawn F:\vue\demo2\node_modules\esbuild\esbuild.exe ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
    at onErrorNT (node:internal/child_process:480:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (node:internal/child_process:288:12)
    at onErrorNT (node:internal/child_process:480:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'spawn F:\\vue\\demo2\\node_modules\\esbuild\\esbuild.exe',
  path: 'F:\\vue\\demo2\\node_modules\\esbuild\\esbuild.exe',
  spawnargs: [ '--service=0.12.14', '--ping' ]
}

执行代码段:

node node_modules/esbuild/install.js

再重新运行项目

npm run dev

 vite搭建项目提示Error: spawn F:\vue\demo2\node_modules\esbuild\esbuild.exe ENOENT errno: -4058,_第1张图片

完美解决

vite搭建项目提示Error: spawn F:\vue\demo2\node_modules\esbuild\esbuild.exe ENOENT errno: -4058,_第2张图片

 

你可能感兴趣的:(网站建设,web常见问题,web开发教程,vue.js,javascript,前端)