-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] failed optional dependency builds should not prevent global install of packages #7355
Comments
If it's helpful, here are the manifests before/after including Without `fullMetadata: true`
{
name: 'fsevents',
version: '2.3.3',
devDependencies: { 'node-gyp': '^9.4.0' },
dist: {
integrity: 'sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==',
shasum: 'cac6407785d03675a2a5e1a5305c697b347d90d6',
tarball: 'https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz',
fileCount: 6,
unpackedSize: 173224,
signatures: [ [Object] ]
},
engines: { node: '^8.16.0 || ^10.6.0 || >=11.0.0' },
os: [ 'darwin' ],
hasInstallScript: true,
_id: 'fsevents@2.3.3',
_resolved: 'https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz',
_from: 'fsevents@~2.3.2',
_integrity: 'sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==',
_signatures: [
{
keyid: 'SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA',
sig: 'MEUCIBqKmzRJwFJcSLXc/SdNTdFsUQvsS/tX+pFHr2JkniDbAiEAiTjoxV3W2IK2g8Udbes/ZP46+TtL40PX3IX/bxosfWs='
}
]
} With `fullMetadata: true`
{
name: 'fsevents',
version: '2.3.3',
description: 'Native Access to MacOS FSEvents',
main: 'fsevents.js',
types: 'fsevents.d.ts',
os: [ 'darwin' ],
engines: { node: '^8.16.0 || ^10.6.0 || >=11.0.0' },
scripts: {
clean: 'node-gyp clean && rm -f fsevents.node',
build: 'node-gyp clean && rm -f fsevents.node && node-gyp rebuild && node-gyp clean',
test: '/bin/bash ./test.sh 2>/dev/null',
prepublishOnly: 'npm run build',
install: 'node-gyp rebuild'
},
repository: { type: 'git', url: 'git+https://github.com/fsevents/fsevents.git' },
keywords: [ 'fsevents', 'mac' ],
contributors: [
{ name: 'Philipp Dunkel', email: 'pip@pipobscure.com' },
{ name: 'Ben Noordhuis', email: 'info@bnoordhuis.nl' },
{ name: 'Elan Shankar', email: 'elan.shanker@gmail.com' },
{ name: 'Miroslav Bajtoš', email: 'mbajtoss@gmail.com' },
{ name: 'Paul Miller', url: 'https://paulmillr.com' }
],
bugs: { url: 'https://github.com/fsevents/fsevents/issues' },
homepage: 'https://github.com/fsevents/fsevents',
devDependencies: { 'node-gyp': '^9.4.0' },
gypfile: true,
gitHead: '2db891e51aa0f2975c5eaaf6aa30f13d720a830a',
_id: 'fsevents@2.3.3',
_nodeVersion: '18.17.1',
_npmVersion: '9.6.7',
dist: {
integrity: 'sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==',
shasum: 'cac6407785d03675a2a5e1a5305c697b347d90d6',
tarball: 'https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz',
fileCount: 6,
unpackedSize: 173224,
signatures: [ [Object] ]
},
_npmUser: { name: 'pipobscure', email: 'pip@pipobscure.com' },
directories: {},
maintainers: [
{ name: 'pipobscure', email: 'pip@pipobscure.com' },
{ name: 'paulmillr', email: 'paul@paulmillr.com' }
],
_npmOperationalInternal: {
host: 's3://npm-registry-packages',
tmp: 'tmp/fsevents_2.3.3_1692635062642_0.01197687980904627'
},
_hasShrinkwrap: false,
_time: '2023-08-21T16:24:22.854Z',
_resolved: 'https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz',
_from: 'fsevents@~2.3.2',
_integrity: 'sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==',
_signatures: [
{
keyid: 'SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA',
sig: 'MEUCIBqKmzRJwFJcSLXc/SdNTdFsUQvsS/tX+pFHr2JkniDbAiEAiTjoxV3W2IK2g8Udbes/ZP46+TtL40PX3IX/bxosfWs='
}
]
} |
This appears to have been working by accident before. The minified packument does not have This is still a bug, but the bug is that this should not be failing in global mode. Local mode gracefully catches this:
|
Thanks for confirming, indeed that sounds more reasonable as an explanation - I wouldn't expect optional dependencies to fail a global install. I do wonder when that "scripts": {
"clean": "node-gyp clean && rm -f fsevents.node",
"build": "node-gyp clean && rm -f fsevents.node && node-gyp rebuild && node-gyp clean",
"test": "/bin/bash ./test.sh 2>/dev/null",
"prepublishOnly": "npm run build"
}, (from https://www.npmjs.com/package/fsevents?activeTab=code) |
It's added automatically by npm during publish because it detects no existing |
Got the same issue. |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
With the inclusion of #7126 in v10.4 global installs of packages that have transient dependencies on packages like
fsevents
started failing.Example Logs
Expected Behavior
Global installs should not fail.
fsevents
is an optional peerDependency, and installing it should not trigger a rebuild, nor fail on unsupported systems (like Linux/Windows).Steps To Reproduce
npm i -g nativescript
To confirm the linked change breaks it:
node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js
of your global packages// fullMetadata: true,
npm i -g nativescript
Environment
The text was updated successfully, but these errors were encountered: