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

ESBuild always fails with the signal SIGSEGV #4002

Open
solaritygh opened this issue Dec 14, 2024 · 1 comment
Open

ESBuild always fails with the signal SIGSEGV #4002

solaritygh opened this issue Dec 14, 2024 · 1 comment

Comments

@solaritygh
Copy link

solaritygh commented Dec 14, 2024

Every time I try to install most packages, they fail with the signal SIGSEGV. I've tried everything, every solution on google, uninstalling and reinstalling node, etc. Nothing works. I have no errors with nothing else. This error started when I installed Endeavour OS yesterday, and node just hasn't worked even though it works fine on literally everything else.

Extra Info:
My project is stored on a NTFS drive, and for some reason every time I use it, I have to use ntfsfix.
I'm cloning the project from the Github Desktop app.
I'm using vscode.
I have the NPM version 10.9.2, and the node version v20.11.1
I've tried the lts, v18, v20.11.1, the latest version, and none of them work.

System info:
https://imgur.com/a/OOx5KRc

The error:

[solarity@solarity-ms7c91 solarmath]$ npm i astro
npm error code 1
npm error path /run/media/solarity/Data/Documents/Github/solarmath/node_modules/astro/node_modules/esbuild
npm error command failed
npm error command sh -c node install.js
npm error node:internal/errors:932
npm error   const err = new Error(message);
npm error               ^
npm error
npm error Error: Command failed: /run/media/solarity/Data/Documents/Github/solarmath/node_modules/astro/node_modules/esbuild/bin/esbuild --version
npm error     at checkExecSyncError (node:child_process:890:11)
npm error     at Object.execFileSync (node:child_process:926:15)
npm error     at validateBinaryVersion (/run/media/solarity/Data/Documents/Github/solarmath/node_modules/astro/node_modules/esbuild/install.js:99:28)
npm error     at /run/media/solarity/Data/Documents/Github/solarmath/node_modules/astro/node_modules/esbuild/install.js:283:5 {
npm error   status: null,
npm error   signal: 'SIGSEGV',
npm error   output: [ null, Buffer(0) [Uint8Array] [], Buffer(0) [Uint8Array] [] ],
npm error   pid: 186382,
npm error   stdout: Buffer(0) [Uint8Array] [],
npm error   stderr: Buffer(0) [Uint8Array] []
npm error }
npm error
npm error Node.js v20.11.1
npm error A complete log of this run can be found in: /home/solarity/.npm/_logs/2024-12-14T17_45_33_426Z-debug-0.log
[solarity@solarity-ms7c91 solarmath]$ [solarity@solarity-ms7c91 solarmath]$ npm i astro
npm error code 1
npm error path /run/media/solarity/Data/Documents/Github/solarmath/node_modules/astro/node_modules/esbuild
npm error command failed
npm error command sh -c node install.js
npm error node:internal/errors:932
npm error   const err = new Error(message);
npm error               ^
npm error
npm error Error: Command failed: /run/media/solarity/Data/Documents/Github/solarmath/node_modules/astro/node_modules/esbuild/bin/esbuild --version
npm error     at checkExecSyncError (node:child_process:890:11)
[solarity@solarity-ms7c91 solarmath]$ an be found in: /home/solarity/.npm/_logs/2024-12-14T17_45_33_426Z-debug-0.log.js:283:5 {uild/install.js:99:28)
@solaritygh solaritygh changed the title ESBuild always fails with the signal SEGSEGV ESBuild always fails with the signal SIGSEGV Dec 15, 2024
@evanw
Copy link
Owner

evanw commented Dec 19, 2024

Sorry but this likely means the problem is on your end. You will have to debug this yourself. Since esbuild is a binary executable, it is platform-specific once installed.

Getting a SIGSEGV here likely means the version of esbuild that was installed by npm isn't for your current platform. This can happen in various situations such as when you run npm using a different OS and/or architecture than the one that esbuild runs with (e.g. when running Linux on Windows, or when running x86 npm on ARM macOS). The specifics of how to debug and fix this misconfiguration depends on the situation. The esbuild package uses node's process.platform and os.arch() APIs to determine what the appropriate platform is. It could be that this is misconfigured on your system.

It could also be that esbuild's executable is for the correct platform, but something about your configured OS cannot run the executable (I know nothing about Endeavour OS). You'd know whether that's the case or not if you download and compile esbuild yourself and even that doesn't work (install the Go compiler + git clone https://github.com/evanw/esbuild + go build ./cmd/esbuild + ./esbuild --version). If that works then there's something wrong with your npm and you should be able to fix it. But if that doesn't work, then something is really wrong and esbuild may not work on your OS.

Another workaround is to use the esbuild-wasm package, which likely works if node works on your OS because the WASM file is interpreted by node instead of being executed by the OS.

And if you want to install esbuild such that it runs on more than one OS at once from the same directory tree, see these instructions: https://esbuild.github.io/getting-started/#simultaneous-platforms. In case that helps.

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

No branches or pull requests

2 participants