esbuild: Broken install binary on macOS

I’m guessing this is a new bug since this project supports macOS (didn’t test with older versions).

Running yarn add -D esbuild installs this package as expected, however this is the installed binary:

% cat node_modules/esbuild/bin/esbuild
#!/usr/bin/env node
throw new Error(`esbuild: Failed to install correctly`);

System is macOS 10.15.7 (19H2), yarn v1.22.4, node v12.16.1

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 25 (4 by maintainers)

Commits related to this issue

Most upvoted comments

same problem using npm in Mac

it can be sloved by:

node node_modules/esbuild/install.js

before npm run dev

You’re not helping debug the issue. If you don’t want to respond to questions or help find a solution then you can leave. It’s not complicated ❤️

same problem using npm in Mac

it can be sloved by:

node node_modules/esbuild/install.js

before npm run dev

Problem fixed, thank you 😃

Your team members must loving working with you.

That was uncalled for. Please keep the discussion to the issue you’re having and free from personal remarks like this.

I’m getting the same problem and ignore-scripts is also false.

Version: 0.8.32 MacOS 10.14.6 using npm 7.3.0

What are you talking about, I responded to a direct question. Your team members must loving working with you.

Ok, and it’s ok to tell random folk in discord If you don't want to respond to questions or help find a solution then you can leave

As you can tell hehhey has 10x more time in the day to write then I do

@heyheyhello nice random downvote

Ok let’s walk you through it 🙃

You’ve ran an npm command but are you using that as your package manager when you encountered the error? (This question was already asked). There have been specific issues with Yarn regarding the esbuild executable, so this is important to know.

When you run the installation from your package manager, do you see output related to the post-install script that installs esbuild? (This question was already asked). Other people have been helpful in providing the output and debug information; you could share that too 😃

Some other questions: Is this reproducable? or a one time thing that was fixed after redoing the install. Have you tried to run the installation manually? Also, as a member of the Vite community, have you heard of other people having the issue?

Thanks ☀️

I’m getting the same problem and ignore-scripts is also false.

Version: 0.8.32 MacOS 10.14.6 using npm 7.3.0

I can only get it working after first installing an older version. I think npm i --verbose esbuild@0.7.0 installed a working binary for me. After which I can install version 0.8.32… even after rm -rf node_modules – not sure what’s being cached where re: side effect of installing an older version first.

It stopped working with vite

/Users/nikos/WebstormProjects/mentorcv/node_modules/esbuild/bin/esbuild:2
throw new Error(`esbuild: Failed to install correctly
^

Error: esbuild: Failed to install correctly

Make sure you don't have "ignore-scripts" set to true. You can check this with
"npm config get ignore-scripts". If that returns true you can reset it back to
false using "npm config set ignore-scripts false" and then reinstall esbuild.```