Skip to content

fix: add --prefix to npm install to target correct project directory#88

Merged
nitinkumar-saucelabs merged 1 commit intomainfrom
fix/npm-install-prefix-project-path
Feb 24, 2026
Merged

fix: add --prefix to npm install to target correct project directory#88
nitinkumar-saucelabs merged 1 commit intomainfrom
fix/npm-install-prefix-project-path

Conversation

@nitinkumar-saucelabs
Copy link
Contributor

Description

npm install was installing packages into the wrong directory. When npm.packages is set, we rename the project's package.json before install, so npm walks up and finds the runner's package.json instead — putting everything in the runner's node_modules/ where Cypress can't find it.

Fixed by passing --prefix projectPath to npm install, same way npm rebuild already does it.

@nitinkumar-saucelabs nitinkumar-saucelabs requested a review from a team as a code owner February 24, 2026 11:37
@nitinkumar-saucelabs nitinkumar-saucelabs force-pushed the fix/npm-install-prefix-project-path branch from 1117777 to 3555aba Compare February 24, 2026 11:40
Copy link

@perf2711 perf2711 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@nitinkumar-saucelabs nitinkumar-saucelabs merged commit 6bd76e2 into main Feb 24, 2026
1 check passed
@nitinkumar-saucelabs nitinkumar-saucelabs deleted the fix/npm-install-prefix-project-path branch February 24, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants