[Bug 298822] misc/gemini-cli: fails to build with npm 12 (--nodedir rejected, node-pty not compiled)

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 24 Sep 2026 14:35:53 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=298822

            Bug ID: 298822
           Summary: misc/gemini-cli: fails to build with npm 12 (--nodedir
                    rejected, node-pty not compiled)
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: yuri@freebsd.org
          Reporter: transitive@gmail.com
             Flags: maintainer-feedback?(yuri@freebsd.org)
          Assignee: yuri@freebsd.org

Created attachment 275074
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=275074&action=edit
gemini-cli-fix

misc/gemini-cli 0.49.0 fails to build with npm 12.

1. do-build runs `npm rebuild --nodedir=${LOCALBASE}`. npm 12 rejects
   unknown CLI flags:

     npm error code EUNKNOWNCONFIG
     npm error Unknown cli flag: --nodedir

2. Moving the setting to the environment (npm_config_nodedir) gets past
   that error, but `npm rebuild` in the node-pty directory then does not
   compile anything. The build "succeeds" in seconds, and the package step
   fails because node-pty/build/Release/pty.node and the other build/
   files listed in pkg-plist do not exist.

3. Once node-pty is actually compiled, `poudriere testport` fails
   check-plist with "Orphaned" errors for the node-gyp intermediates
   (build/Release/.deps/..., build/Release/obj.target/...).

The attached patch calls node-gyp directly for node-pty
(`npm exec --offline -- node-gyp rebuild --nodedir=${LOCALBASE}`) and
removes build/Release/.deps and build/Release/obj.target afterwards so
they are not packaged. No pkg-plist change is needed.

Tested with `poudriere testport -j 15amd64 -p Default misc/gemini-cli`
(FreeBSD 15.1-STABLE amd64, npm 12.0.2 (www/npm, node24), ports tree at
6aec752562):
builds, passes check-plist, and packages successfully.

-- 
You are receiving this mail because:
You are the assignee for the bug.