"npm run dev" failed because of esbuild.

See original GitHub issue

⚠️ IMPORTANT ⚠️ Please do not ignore this template. If you do, your issue will be closed immediately.

Describe the bug

After init a vite project, run “npm run dev” failed.

Reproduction

npm init @vitejs/app Project name: · vite-project
Select a template: · vue-ts

System Info

  • vite version: 2.0.5
  • Operating System: win10 20H2 19042.844
  • Node version: v14.16.0
  • Package manager (npm/yarn/pnpm) and version: npm 7.6.0

Logs (Optional if provided reproduction)

PS H:\tutorial> npm init @vitejs/app √ Project name: · vite-project

Scaffolding project in H:\tutorial\vite-project… √ Select a template: · vue-ts

Done. Now run:

cd vite-project npm install npm run dev

PS H:\tutorial> cd .\vite-project
PS H:\tutorial\vite-project> npm install

added 60 packages in 3s PS H:\tutorial\vite-project> npm run dev

vite-project@0.0.0 dev vite

events.js:292 throw er; // Unhandled ‘error’ event ^

Error: spawn H:\tutorial\vite-project\node_modules\esbuild\esbuild.exe ENOENT at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19) at onErrorNT (internal/child_process.js:465:16) at processTicksAndRejections (internal/process/task_queues.js:80:21) Emitted ‘error’ event on ChildProcess instance at: at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12) at onErrorNT (internal/child_process.js:465:16) at processTicksAndRejections (internal/process/task_queues.js:80:21) { errno: -4058, code: ‘ENOENT’, syscall: ‘spawn H:\tutorial\vite-project\node_modules\esbuild\esbuild.exe’, path: ‘H:\tutorial\vite-project\node_modules\esbuild\esbuild.exe’, spawnargs: [ ‘–service=0.8.57’, ‘–ping’ ] }

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
proghax333commented, Jul 1, 2021

Hey @sandy-74, it’s probably because of some NPM / other registry config problem. I faced the same issue because I had my NPM ignore-scripts config set to true. If this is the case for you, you can change it by doing: npm config set ignore-scripts false. There probably are ways to do this manually, but this is the quickest (but unsafe) way to fix it.

0reactions
aaryak-shahcommented, Jul 1, 2021

Thanks! Running npm config set ignore-scripts false and reinstalling all node modules fixed the issue for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lararel Vite - npm run dev didn't work on CentOS
Node version: v10.23.1 npm version: 6.14.10. The error while I try to run npm run dev or npm run build : [user@server ssh-test-app]$...
Read more >
API - ESBuild
Bundling with esbuild only works with statically-defined imports (i.e. when the import path is a string literal). Imports that are defined at run-time...
Read more >
laravel react vite having issue when i run npm run dev
This the error being displayed [vite] Internal server error: The service is no longer running Plugin: vite:esbuild File: ...
Read more >
esbuild - npm
Start using esbuild in your project by running `npm i esbuild`. There are 2374 other projects in the npm registry using esbuild.
Read more >
React app doesn't deploy via git repo but does with netlify-cli
When netlify tries to deploy the app from the repo, it fails with the… ... I tried to replace npm run build by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found