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

MSYS2-MinGW64: make failed error while doing npm install #52

Open
aamirglb opened this issue Jan 14, 2025 · 0 comments
Open

MSYS2-MinGW64: make failed error while doing npm install #52

aamirglb opened this issue Jan 14, 2025 · 0 comments

Comments

@aamirglb
Copy link
Contributor

Hi,
I compiled the libpostal C library using MSYS2 on Windows 11, using GCC 14.2.0. After that I cloned the node-postal and updated the binding.gyp file for MSYS2-MinGW64 as follows:

{
    "targets": [
        {
            "target_name": "expand",
            "sources": [
                "src/expand.cc"
            ],
            "libraries": [
                "-lpostal", "-L/mingw64/lib"
            ],
            "include_dirs": [
                "<!(node -e \"require('nan')\")",
                "/mingw64/include",
            ]
        },
        {
            "target_name": "parser",
            "sources": [
                "src/parser.cc"
            ],
            "libraries": [
                "-lpostal", "-L/mingw64/lib"
            ],
            "include_dirs": [
                "<!(node -e \"require('nan')\")",
                "/mingw64/include",
            ]
        }
    ]
}

When I try to install node-postal using npm install, I get the following error:

gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/c/temp/postal-test/node-postal/build'
expand.target.mk:89: *** target pattern contains no '%'.  Stop.
make: Leaving directory '/c/temp/postal-test/node-postal/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.<anonymous> (C:\temp\postal-test\msys64\mingw64\lib\node_modules\npm\node_modules\node-gyp\lib\build.js:216:23)
gyp ERR! stack at ChildProcess.emit (node:events:513:28)
gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12)
gyp ERR! System MINGW32_NT-10.0 10.0.22631
gyp ERR! command "C:\\temp\\postal-test\\msys64\\mingw64\\bin\\node.exe" "C:\\temp\\postal-test\\msys64\\mingw64\\lib\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\temp\postal-test\node-postal
gyp ERR! node -v v23.5.0
gyp ERR! node-gyp -v v11.0.0
gyp ERR! not ok

Following lines in auto generated expand.target.mk are causing this error:

$(OBJS): TOOLSET := $(TOOLSET)
$(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE))  $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE))
$(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE))  $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE))

How can I fix this error?
Thanks in advance

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

1 participant