Skip to content

Build Error C2338 using VS2019 and x86 configuration for node.js 18.x #3869

Closed
@mheller82

Description

@mheller82

Details

I try to compile node.js 18.x from the sources. As described I installed VS2019 (latest version), NASM and Python 3.10.4 on my windows machine.

The x64 build works nicely. The x86 build fails (on several machines). I get an compile error code C2338. I run the following command vcbuild.bat package x86. When I run vcbuild.bat package x64 everything is fine.

Is the documentation incomplete or do I miss some tools needed for building node.js 18.x (14.x and 16.x I can build in x86 and x64)

The following errors are shown on the command line

Checking inspector protocol compatibility, and also Generating inspector protocol sources from protocol json
C:\Users\mail\Downloads\node-v18.2.0\deps\v8\src\heap\spaces.h(320,1): error C2338: sizeof(MemoryChunk) <= MemoryChunk:
:kHeaderSize [C:\Users\mail\Downloads\node-v18.2.0\tools\v8_gypfiles\v8_init.vcxproj]
C:\Users\mail\Downloads\node-v18.2.0\deps\v8\src\heap\spaces.h(321,1): error C2338: sizeof(Page) <= MemoryChunk::kHeade
rSize [C:\Users\mail\Downloads\node-v18.2.0\tools\v8_gypfiles\v8_init.vcxproj]
Assembling ....\deps\v8\src\heap\base\asm\ia32\push_registers_masm.S...
C:\Users\mail\Downloads\node-v18.2.0\deps\v8\src\heap\large-spaces.h(56,1): error C2338: sizeof(LargePage) <= MemoryChu
nk::kHeaderSize [C:\Users\mail\Downloads\node-v18.2.0\tools\v8_gypfiles\v8_init.vcxproj]
C:\Users\mail\Downloads\node-v18.2.0\deps\v8\src\heap\spaces.h(320,1): error C2338: sizeof(MemoryChunk) <= MemoryChunk:
:kHeaderSize [C:\Users\mail\Downloads\node-v18.2.0\tools\v8_gypfiles\v8_compiler.vcxproj]
C:\Users\mail\Downloads\node-v18.2.0\deps\v8\src\heap\spaces.h(321,1): error C2338: sizeof(Page) <= MemoryChunk::kHeade
rSize [C:\Users\mail\Downloads\node-v18.2.0\tools\v8_gypfiles\v8_compiler.vcxproj]
C:\Users\mail\Downloads\node-v18.2.0\deps\v8\src\heap\large-spaces.h(56,1): error C2338: sizeof(LargePage) <= MemoryChu
nk::kHeaderSize [C:\Users\mail\Downloads\node-v18.2.0\tools\v8_gypfiles\v8_compiler.vcxproj]
v8_pch.cc
C:\Users\mail\Downloads\node-v18.2.0\deps\v8\src\heap\spaces.h(320,1): error C2338: sizeof(MemoryChunk) <= MemoryChunk:
:kHeaderSize [C:\Users\mail\Downloads\node-v18.2.0\tools\v8_gypfiles\v8_base_without_compiler.vcxproj]
C:\Users\mail\Downloads\node-v18.2.0\deps\v8\src\heap\spaces.h(321,1): error C2338: sizeof(Page) <= MemoryChunk::kHeade
rSize [C:\Users\mail\Downloads\node-v18.2.0\tools\v8_gypfiles\v8_base_without_compiler.vcxproj]
C:\Users\mail\Downloads\node-v18.2.0\deps\v8\src\heap\large-spaces.h(56,1): error C2338: sizeof(LargePage) <= MemoryChu
nk::kHeaderSize [C:\Users\mail\Downloads\node-v18.2.0\tools\v8_gypfiles\v8_base_without_compiler.vcxproj]

Node.js version

18.x

Example code

No response

Operating system

Windows 11
VS 2019 Enterprise
Python 3.10.4
NASM (latest installer)

Scope

code

Module and version

Not applicable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions