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

Report an EBADPLATFORM error during installation on MacOS #3907

Open
4 tasks done
ukea opened this issue May 20, 2024 · 7 comments
Open
4 tasks done

Report an EBADPLATFORM error during installation on MacOS #3907

ukea opened this issue May 20, 2024 · 7 comments
Labels
bug: pending triage Maybe a bug, waiting for confirmation

Comments

@ukea
Copy link

ukea commented May 20, 2024

Describe the bug

Hi sir, When I tried to install vitepress by running the command npm add -D vitepress,

image

it reports an error:

npm error code EBADPLATFORM
npm error notsup Unsupported platform for esbuild-darwin-arm64@0.14.49: wanted {"os":"darwin","cpu":"arm64"} (current: {"os":"darwin","cpu":"x64"})
npm error notsup Valid os:   darwin
npm error notsup Actual os:  darwin
npm error notsup Valid cpu:  arm64
npm error notsup Actual cpu: x64
npm error A complete log of this run can be found in: /Users/admin/.npm/_logs/2024-05-20T08_58_27_221Z-debug-0.log

image

Here is the log:
2024-05-20T08_58_27_221Z-debug-0.log

Reproduction

run the command npm add -D vitepress on M1 Mac mini in VSCode

Expected behavior

Vitepress installed successfully.

System Info

MacOS 14.4.1 (23E224)
Mac mini M1, 2020
VSCode info:

Version: 1.89.1 (Universal)
Commit: dc96b837cf6bb4af9cd736aa3af08cf8279f7685
Date: 2024-05-07T05:14:24.611Z (1 wk ago)
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Darwin arm64 23.4.0

image

Additional context

No response

Validations

@ukea ukea added the bug: pending triage Maybe a bug, waiting for confirmation label May 20, 2024
@brc-dd
Copy link
Member

brc-dd commented May 20, 2024

Can you tell what's your node version (output of node --version, vscode likely has nothing to with this)? Can you try upgrading it to latest LTS?

I'm not sure but your node/npm looks broken because it's detecting cpu as x64 on m1. cpu should be arm64 on m1.

@ukea
Copy link
Author

ukea commented May 20, 2024

node version is v21.7.1 @brc-dd
image

@ukea
Copy link
Author

ukea commented May 20, 2024

Maybe it's because my vscode is Universal, not Apple Silicon? I guess.
image

@brc-dd
Copy link
Member

brc-dd commented May 20, 2024

Is it happening if you run from mac terminal instead of vscode's integrated one?

@brc-dd
Copy link
Member

brc-dd commented May 20, 2024

Can you share the output of following commands -

npm --version
node -e "console.log(process.arch)"

@ukea
Copy link
Author

ukea commented May 21, 2024

The same with the mac terminal. Maybe this is something wrong with package "esbuild-darwin-arm64"? @brc-dd
image

And the output of the prompt above is:

10.8.0
x64

image

Obviously my mac is not the x64 cpu

image

Many thanks~

@brc-dd
Copy link
Member

brc-dd commented May 21, 2024

It seems the issue is with your node installation. Can you try re-installing some other version? node -e "console.log(process.arch)" should log arm64 on m1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: pending triage Maybe a bug, waiting for confirmation
Projects
None yet
Development

No branches or pull requests

2 participants