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

Error: esbuild: Failed to install correctly #1603

Closed
fundon opened this issue Sep 14, 2021 · 4 comments
Closed

Error: esbuild: Failed to install correctly #1603

fundon opened this issue Sep 14, 2021 · 4 comments

Comments

@fundon
Copy link

fundon commented Sep 14, 2021

Platform: FreeBSD 13
Node: 16.2.0
Npm: 6.14.8
Yarn: 1.22.11

$ yarn
yarn install v1.22.11
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "freebsd" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "freebsd" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > @vue/[email protected]" has incorrect peer dependency "eslint@>= 1.6.0 < 7.0.0".
warning "@vue/cli-plugin-eslint > [email protected]" has incorrect peer dependency "eslint@>=1.6.0 <7.0.0".
warning " > [email protected]" has incorrect peer dependency "eslint@^5.0.0 || ^6.0.0".
[4/4] Building fresh packages...
[-/6] ⠄ waiting...
[2/6] ⠄ esbuild
[-/6] ⠄ waiting...
[-/6] ⠄ waiting...
error /node_modules/esbuild: Command failed.
Exit code: 1
Command: node install.js
Arguments:
Directory: /node_modules/esbuild
Output:

$ node node_modules/esbuild/install.js
exec_new_vmspace: mapping stack size 0x20000000 prot 0x7 failed mach error 2 errno 13
The version of the downloaded binary is incorrect: Command failed: /node_modules/esbuild/bin/esbuild__ --version
Install unsuccessful

@fundon
Copy link
Author

fundon commented Sep 14, 2021

> vite build


<--- Last few GCs --->

[75723:0x803ab6bc0]       93 ms: Scavenge 14.2 (16.6) -> 13.3 (17.3) MB, 0.4 / 0.0 ms  (average mu = 1.000, current mu = 1.000) allocation failure
[75723:0x803ab6bc0]       99 ms: Scavenge 15.0 (17.6) -> 14.4 (18.6) MB, 0.5 / 0.0 ms  (average mu = 1.000, current mu = 1.000) allocation failure
[75723:0x803ab6bc0]      106 ms: Scavenge 15.7 (18.6) -> 15.2 (23.6) MB, 0.5 / 0.0 ms  (average mu = 1.000, current mu = 1.000) allocation failure


<--- JS stacktrace --->

FATAL ERROR: WasmCodeManager::Commit: Cannot make pre-reserved region writable Allocation failed - process out of memory
 1: 0x175fe90 node::Abort() [/usr/local/bin/node]
 2: 0x175fffc node::OnFatalError(char const*, char const*) [/usr/local/bin/node]
 3: 0x1900cd3 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
 4: 0x1900c79 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
 5: 0x1f6a363 v8::internal::wasm::WasmCodeAllocator::AllocateForCodeInRegion(v8::internal::wasm::NativeModule*, unsigned long, v8::base::AddressRegion, v8::internal::wasm::WasmCodeAllocator::OptionalLock const&) [/usr/local/bin/node]
 6: 0x1f6b23a v8::internal::wasm::NativeModule::CreateEmptyJumpTableInRegion(int, v8::base::AddressRegion, v8::internal::wasm::WasmCodeAllocator::OptionalLock const&) [/usr/local/bin/node]
 7: 0x1f69b00 v8::internal::wasm::NativeModule::AddCodeSpace(v8::base::AddressRegion, v8::internal::wasm::WasmCodeAllocator::OptionalLock const&) [/usr/local/bin/node]
 8: 0x1f6b020 v8::internal::wasm::NativeModule::NativeModule(v8::internal::wasm::WasmEngine*, v8::internal::wasm::WasmFeatures const&, v8::internal::VirtualMemory, std::__1::shared_ptr<v8::internal::wasm::WasmModule const>, std::__1::shared_ptr<v8::internal::Counters>, std::__1::shared_ptr<v8::internal::wasm::NativeModule>*) [/usr/local/bin/node]
 9: 0x1f6e3bc v8::internal::wasm::WasmCodeManager::NewNativeModule(v8::internal::wasm::WasmEngine*, v8::internal::Isolate*, v8::internal::wasm::WasmFeatures const&, unsigned long, std::__1::shared_ptr<v8::internal::wasm::WasmModule const>) [/usr/local/bin/node]
10: 0x1f7f01e v8::internal::wasm::WasmEngine::NewNativeModule(v8::internal::Isolate*, v8::internal::wasm::WasmFeatures const&, std::__1::shared_ptr<v8::internal::wasm::WasmModule const>, unsigned long) [/usr/local/bin/node]
11: 0x1f3f8aa v8::internal::wasm::AsyncCompileJob::CreateNativeModule(std::__1::shared_ptr<v8::internal::wasm::WasmModule const>, unsigned long) [/usr/local/bin/node]
12: 0x1f3faa3 v8::internal::wasm::AsyncCompileJob::GetOrCreateNativeModule(std::__1::shared_ptr<v8::internal::wasm::WasmModule const>, unsigned long) [/usr/local/bin/node]
13: 0x1f4add3 v8::internal::wasm::AsyncCompileJob::PrepareAndStartCompile::RunInForeground(v8::internal::wasm::AsyncCompileJob*) [/usr/local/bin/node]
14: 0x1f4ac48 v8::internal::wasm::AsyncCompileJob::CompileStep::Run(v8::internal::wasm::AsyncCompileJob*, bool) [/usr/local/bin/node]
15: 0x1f4ab41 v8::internal::wasm::AsyncCompileJob::CompileTask::RunInternal() [/usr/local/bin/node]
16: 0x17dae47 node::PerIsolatePlatformData::RunForegroundTask(std::__1::unique_ptr<v8::Task, std::__1::default_delete<v8::Task> >) [/usr/local/bin/node]
17: 0x17d9898 node::PerIsolatePlatformData::FlushForegroundTasksInternal() [/usr/local/bin/node]
18: 0x2265fbb uv_async_send [/usr/local/bin/node]
19: 0x22775eb uv_free_interface_addresses [/usr/local/bin/node]
20: 0x2266538 uv_run [/usr/local/bin/node]
21: 0x1697caf node::SpinEventLoop(node::Environment*) [/usr/local/bin/node]
22: 0x17ab5b6 node::NodeMainInstance::Run(node::EnvSerializeInfo const*) [/usr/local/bin/node]
fish: Job 1, 'npm run-script build' terminated by signal SIGABRT (Abort)

@evanw
Copy link
Owner

evanw commented Sep 21, 2021

Unfortunately I'm very unfamiliar with FreeBSD and don't have a FreeBSD VM accessible for testing, so I'm not going to be able to help here. The FreeBSD build was working for the person who added FreeBSD support: #217.

One thing to check is whether the underlying esbuild executable works at all or not. Here's a simple way to check:

$ git clone --depth 1 --branch v0.12.28 https://github.com/evanw/esbuild.git
$ cd esbuild
$ CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 go build -o esbuild ./cmd/esbuild
$ ./esbuild --version

If that doesn't work then the problem is presumably with Go's FreeBSD support itself and there isn't anything that can be done by esbuild to fix the problem.

The second post about the WASM build just seems like your machine doesn't have enough memory since it says process out of memory. The solution to that would be to give your machine more RAM.

@fundon
Copy link
Author

fundon commented Sep 21, 2021

golang/go#48112

@fundon fundon closed this as completed Sep 21, 2021
@evanw
Copy link
Owner

evanw commented Sep 21, 2021

Thanks for the link. It sounds like this will naturally be fixed eventually when esbuild upgrades to the next Go version.

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

2 participants