Repository navigation
Commit 51c2bf8
authored
fix: don't print the funding message for global installs (#9864)
## What / Why
A global install prints "N packages are looking for funding / run `npm
fund` for details", but nothing can be done with it. `npm fund -g` fails
with `EFUNDGLOBAL`, and a bare `npm fund` loads the tree at the local
prefix, so outside a project it prints the directory name and nothing
else.
`packagesFundingMessage` in `lib/utils/reify-output.js` never looked at
`npm.global`, so the hint went out for global installs too. It now
returns early in that case. Making `npm fund -g` work is a separate
feature request; #3112 already splits it out that way.
## Testing
New case in `test/lib/utils/reify-output.js`, mirroring the existing
`fund: false` one: with `global: true` the output no longer mentions
funding. It fails without the change.
## References
Fixes #9863
Fixes #31121 parent 4cdccea commit 51c2bf8
2 files changed
Lines changed: 30 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
| 224 | + | |
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
131 | 160 | | |
132 | 161 | | |
133 | 162 | | |
| |||
0 commit comments