Bug 266159

Summary: www/npm: fails to run commands after upgrade to 8.18.0
Product: Ports & Packages Reporter: Guido Falsi <madpilot>
Component: Individual Port(s)Assignee: Po-Chuan Hsieh <sunpoet>
Status: Closed FIXED    
Severity: Affects Only Me CC: jsegaert
Priority: --- Flags: bugzilla: maintainer-feedback? (sunpoet)
Version: Latest   
Hardware: Any   
OS: Any   
URL: https://github.com/npm/run-script/issues/103
Bug Depends on:    
Bug Blocks: 266140, 266188    
Attachments:
Description Flags
patch v1 none

Description Guido Falsi freebsd_committer freebsd_triage 2022-09-01 15:37:06 UTC
Created attachment 236289 [details]
patch v1

Hi,

I've discovered I'm unable to perform normal "npm run" tasks after the upgrade.

Turns out it is a bug introduces upstream with v 8.17.0:

https://github.com/npm/run-script/issues/103

As stated there this is caused by this pull request:

https://github.com/npm/run-script/pull/98

which adds a '--' argument to shell invocations like: 'sh -c -- echo "foo"'

https://github.com/npm/run-script/blob/2a1854aaf0b788817ad5a45b329dbf3e842430f7/lib/make-spawn-args.js#L70


These fail due to no "--" command existing.

I
'm proposing a patch removing the -- from the sh command line. Unluckily I don't think it is upstreamable in this way.

I'm running successfully with this patch locally.

Thanks in advance!
Comment 1 commit-hook freebsd_committer freebsd_triage 2022-09-04 05:02:33 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=48a2c771bb3ba68c2d4d3d26cb9c282cc25a49b8

commit 48a2c771bb3ba68c2d4d3d26cb9c282cc25a49b8
Author:     Guido Falsi <madpilot@FreeBSD.org>
AuthorDate: 2022-09-04 05:01:45 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2022-09-04 05:01:45 +0000

    www/npm: Fix 'npm run' by removing extra '--'

    PR:             266159

 www/npm/Makefile                  |  1 +
 www/npm/files/patch-npm-run (new) | 11 +++++++++++
 2 files changed, 12 insertions(+)
Comment 2 Po-Chuan Hsieh freebsd_committer freebsd_triage 2022-09-04 05:13:41 UTC
Committed. Thanks!
Comment 3 jsegaert 2022-09-09 04:59:13 UTC
Thank you for this!!!!