fix: lazy load validate npm package name on error message#7347
fix: lazy load validate npm package name on error message#7347wraithgar merged 1 commit intonpm:latestfrom H4ad:perf/startup-time-error-message
Conversation
|
TLDR: normally lazy loading in this module is a 🚨 warning zone 🚨 but not for this particular code path. The danger in lazy loading (especially in this file) is when npm is installing over itself. Unless I'm missing something really obscure I can't imagine why this code path would be called during that situation. Even if we were doing an $ npm i -g npm@latest --loglevel verbose
npm verb cli /Users/wraithgar/.nvm/versions/node/v20.10.0/bin/node /Users/wraithgar/.nvm/versions/node/v20.10.0/bin/npm
npm info using npm@10.5.1
npm info using node@v20.10.0
npm verb title npm i npm@latest
npm verb argv "i" "--global" "npm@latest" "--loglevel" "verbose"
npm verb logfile logs-max:10 dir:/Users/wraithgar/.npm/_logs/2024-04-06T18_08_01_736Z-
npm verb logfile /Users/wraithgar/.npm/_logs/2024-04-06T18_08_01_736Z-debug-0.log
npm http fetch GET 200 https://registry.npmjs.org/npm 234ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/npm 11ms (cache hit)
changed 14 packages in 12s
npm verb exit 0
npm info ok |
|
@H4ad |
|
Approved but I'm gonna ask @lukekarrys to either merge or 👍 for a sensibility check since this is dealing w/ lazy loading and we should be extra cautious. |
This package takes 5ms to load even if we didn't use it.