diff options
author | Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> | 2024-07-11 11:39:45 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-11 18:39:45 +0000 |
commit | 3d0e1b65b1e1a754f6440fff1df873da8b2144a1 (patch) | |
tree | 240dac83d5c5e58d70cfb8b414becc9029cce3b6 /tests/specs/npm/lifecycle_scripts | |
parent | ba63740e7f390a5778baf01ba156f0b02c55a089 (diff) |
fix(node): Ignore broken default install scripts (#24534)
NPM inserts a default install script when a package has a `binding.gyp`
file.
It's possible, however, for the package to exclude the `binding.gyp`
file when they publish, and in this case the install script will never
succeed for a user of the package.
This happens with `fsevents`, for instance. They don't include the
`binding.gyp` file in their published tarball, but the default install
script appears in the manifest served by `npm`.
This causes us to warn that `fsevents` has an install script, but when
you try to run it it fails due to `binding.gyp` not existing.
Diffstat (limited to 'tests/specs/npm/lifecycle_scripts')
-rw-r--r-- | tests/specs/npm/lifecycle_scripts/__test__.jsonc | 15 | ||||
-rw-r--r-- | tests/specs/npm/lifecycle_scripts/fsevents.js | 1 | ||||
-rw-r--r-- | tests/specs/npm/lifecycle_scripts/fsevents.out | 3 |
3 files changed, 19 insertions, 0 deletions
diff --git a/tests/specs/npm/lifecycle_scripts/__test__.jsonc b/tests/specs/npm/lifecycle_scripts/__test__.jsonc index 18a2d405e..5639c83cd 100644 --- a/tests/specs/npm/lifecycle_scripts/__test__.jsonc +++ b/tests/specs/npm/lifecycle_scripts/__test__.jsonc @@ -104,6 +104,21 @@ "output": "conflicting_bin.out" } ] + }, + "fsevents_default_install_script": { + "tempDir": true, + "steps": [ + { + "if": "mac", + "args": "cache fsevents.js", + "output": "fsevents.out" + }, + { + "if": "mac", + "args": "cache --allow-scripts fsevents.js", + "output": "" + } + ] } } } diff --git a/tests/specs/npm/lifecycle_scripts/fsevents.js b/tests/specs/npm/lifecycle_scripts/fsevents.js new file mode 100644 index 000000000..45ddf686f --- /dev/null +++ b/tests/specs/npm/lifecycle_scripts/fsevents.js @@ -0,0 +1 @@ +import {} from "npm:fsevents"; diff --git a/tests/specs/npm/lifecycle_scripts/fsevents.out b/tests/specs/npm/lifecycle_scripts/fsevents.out new file mode 100644 index 000000000..021886593 --- /dev/null +++ b/tests/specs/npm/lifecycle_scripts/fsevents.out @@ -0,0 +1,3 @@ +Download http://localhost:4260/fsevents +Download http://localhost:4260/fsevents/fsevents-2.3.3.tgz +Initialize fsevents@2.3.3 |