-
Notifications
You must be signed in to change notification settings - Fork 1k
npm list fallback, increase timeout to 60s #8702
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls fix tests.
} catch (e) { | ||
// fallback to reading the version directly from package.json if npm list times out | ||
const packageJson = readJsonSync(join(cwd, name, "package.json"), { throws: false }); | ||
return packageJson?.version ? { version: packageJson.version } : undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we choose to use this, we might want to mimic npm list
json structure here. Currently all places calling this function are only using the version, so I only implemented the version for now
@alexastrum FWICT the failing tests are unrelated to these changes.
|
Description
This PR aims to fix the issue reported in #8689. The npm command timeout was increased to 60s due to how slow it runs in non-npm projects, notably with pnpm as reported in the issue.
Additionally, a fallback was added in case the timeout is reached, where the dependency version is read directly from its package.json within node_modules.
Scenarios Tested
deploy Next.js project with pnpm
Sample Commands
firebase deploy