Skip to content

Issue with default Laravel 10 Setup Using NPM: The package "@esbuild/darwin-x64" could not be found, and is needed by esbuild #48839

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

Closed
danielh-official opened this issue Oct 27, 2023 · 2 comments

Comments

@danielh-official
Copy link

Laravel Version

10.10

PHP Version

8.1

Database Driver & Version

No response

Description

When I run npm run dev, I get this in the terminal:

failed to load config from /{project-root}/vite.config.js
error when starting dev server:
Error: The package "@esbuild/darwin-x64" could not be found, and is needed by esbuild.

If you are installing esbuild with npm, make sure that you don't specify the
"--no-optional" or "--omit=optional" flags. The "optionalDependencies" feature
of "package.json" is used by esbuild to install the correct binary executable
for your current platform.

Installing es-build via npm install es-build yields this instead:

Cannot start service: Host version "0.18.20" does not match binary version "0.19.5"

Using yarn works, however.

  1. yarn install
  2. yarn dev

Steps To Reproduce

  1. Run composer create-project laravel/laravel example-app in the path of your choice. You can use a name other than "example-app".
  2. Open in PhpStorm or VS Code.
  3. Run npm i in terminal.
  4. Run npm run dev in the terminal.
  5. Install via npm install es-build and check if you get the second issue in the description.

I'm using an Intel Mac (OS: Sonoma 14.0), so the problem might not exist on Windows or Linux.

@Rizky92
Copy link

Rizky92 commented Oct 29, 2023

This issue doesn't seem related to laravel, but the javascript package manager you're using. See evanw/esbuild#1646 for details

@crynobone
Copy link
Member

Thank you @Rizky92

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants