Bug 266159 - www/npm: fails to run commands after upgrade to 8.18.0
Summary: www/npm: fails to run commands after upgrade to 8.18.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Po-Chuan Hsieh
URL: https://github.com/npm/run-script/iss...
Keywords:
Depends on:
Blocks: 266140 266188
  Show dependency treegraph
 
Reported: 2022-09-01 15:37 UTC by Guido Falsi
Modified: 2022-09-09 04:59 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (sunpoet)


Attachments
patch v1 (853 bytes, patch)
2022-09-01 15:37 UTC, Guido Falsi
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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!!!!