-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix: dependency path is undefined #9013
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
🦋 Changeset detectedLatest commit: 99af642 The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…ojectDir parameter
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.
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
fix #9011
Under the two
package.json
framework, if there are nonode_modules
in theapp
directory andnpmRebuild
is set tofalse
, dependencies will not be reinstalled. As a result,npm list
will return empty. In this case, we should attempt to retrieve thenode_modules
using theprojectDir
, which can resolve this issue.Using

getProjectRootPath
directly fromelectron/rebuild
is not accurate because it recursively searches upward level by level and returns the first match it finds. If I set theapp
directory outside theproject dir
, such as in another directory, the result returned bygetProjectRootPath
inelectron/rebuild
will be incorrect. Therefore, theprojectDir
should be passed in directly instead of searching upward level by level.https://github.com/electron/rebuild/blob/ff1ec40f82ca64e014079b246053f039b3cf4f23/src/search-module.ts#L76-L86