Created attachment 273334 [details] Quote TMPDIR and WRKDIR in npm.mk shell comparisons Mk/Uses/npm.mk contains two shell tests with an unquoted TMPDIR variable. When TMPDIR is unset, the generated shell command becomes: if [ != ${WRKDIR} ]; then and /bin/sh reports: [: !=: unexpected operator This happens during "Archiving prefetched node modules" in npm:fetch. Quoting both variables fixes the issue: if [ "${TMPDIR}" != "${WRKDIR}" ]; then
Good catch!
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=cbeb1be34ba3107114345e52c6b57adc2ec34060 commit cbeb1be34ba3107114345e52c6b57adc2ec34060 Author: Shin-ichi Nagamura <core@zsc.jp> AuthorDate: 2026-07-31 09:15:29 +0000 Commit: Hiroki Tagato <tagattie@FreeBSD.org> CommitDate: 2026-07-31 09:15:29 +0000 Mk/Uses/npm.mk: Quote TMPDIR and WRKDIR in shell comparisons When TMPDIR is unset, the generated shell command becomes: if [ != ${WRKDIR} ]; then and /bin/sh reports: [: !=: unexpected operator Quoting both variables fixes the issue. PR: 297181 Reported by: Shin-ichi Nagamura <core@zsc.jp> Mk/Uses/npm.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Committed, thanks!
Thank you so much for the super fast commit! 迅速な対応ありがとうございました。