Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sometimes can't install esbuild with 3rd-party registry #921

Closed
hairyf opened this issue Mar 5, 2021 · 7 comments · Fixed by #1621
Closed

Sometimes can't install esbuild with 3rd-party registry #921

hairyf opened this issue Mar 5, 2021 · 7 comments · Fixed by #1621

Comments

@hairyf
Copy link

hairyf commented Mar 5, 2021

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

Error: spawn F:\projects\test\my-vue-app\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 F:\\projects\\test\\my-vue-app\\node_modules\\esbuild\\esbuild.exe',
  path: 'F:\\projects\\test\\my-vue-app\\node_modules\\esbuild\\esbuild.exe',
  spawnargs: [ '--service=0.8.55', '--ping' ]
}

The problem was solved after I rolled back esbuild to 0.8.54

@evanw
Copy link
Owner

evanw commented Mar 5, 2021

I assume this means esbuild failed to install correctly. The clues for why that happened are in npm's install messages, not in this error message.

@hairyf
Copy link
Author

hairyf commented Mar 6, 2021

No, npm did not report an error, the installation is normal, but I found no esbuild.exe exists in node_modules/esbuild
But it will be there if the version is rolled back to 0.8.54

@cnscoo
Copy link

cnscoo commented Mar 10, 2021

你是不是使用了镜像来获取npm包?如果是的话,以下步骤可能对你有帮助。

  • 清理npm缓存 npm cache clean -f
  • 删除项目中的 node_modules 文件夹
  • 删除 ~/.npmrc 文件中配置的所有镜像
  • 重新打开一个终端执行依赖安装 npm install.

如果是相同原因,执行完以上步骤应该就可以了。
不过对此我还是不解,我比较过 registry.npm.taobao.org 与 registry.npmjs.org 的文件,发现并没有什么不一样,暂时不清楚产生问题的原因是什么。

@yilihjy
Copy link

yilihjy commented Mar 10, 2021

I met the same problem.

@hairyf
Copy link
Author

hairyf commented Mar 15, 2021

你是不是使用了一部分来来获取npm包?如果是的话,以下步骤可能对你有帮助。

  • 清理npm缓存 npm cache clean -f
  • 删除项目中的node_modules文件夹
  • 删除〜/ .npmrc文件中配置的所有副本
  • 重新打开一个终端执行依赖安装npm install

如果是相同原因,执行完以上步骤应该就可以了。
不过对此我还是不解,我比较过registry.npm.taobao.org与registry.npmjs.org的文件,发现并没有什么不一样,暂时不清楚产生问题的原因是什么。

我使用了你的方法,成功运行了。但有时候还是会有这种情况出现,具体出现的时机我不是很清楚。

@evanw evanw changed the title vite events.js:292 throw er; // Unhandled 'error' event Sometimes can't install esbuild with 3rd-party registry Mar 21, 2021
@evanw
Copy link
Owner

evanw commented Mar 29, 2021

Closing since this is unactionable, and also because 3rd-party registries aren't officially supported. If npm works but a mirror of npm doesn't, then that's a problem with the mirror, not with esbuild.

@evanw evanw closed this as completed Mar 29, 2021
@appbest
Copy link

appbest commented Apr 3, 2021

npm v7 以上有个 Bug,需要执行以下安装

node node_modules/esbuild/install.js

kerwin612 added a commit to kerwin612/vite-plugin-mock that referenced this issue Apr 21, 2022
upgrade esbuild version to fix error from evanw/esbuild#921
anncwb pushed a commit to vbenjs/vite-plugin-mock that referenced this issue Apr 16, 2023
upgrade esbuild version to fix error from evanw/esbuild#921
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants