Skip to content
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

update install-native postinstall to use pnpm #53080

Merged
merged 2 commits into from
Jul 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion scripts/install-native.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ import fs from 'fs-extra'
path.join(tmpdir, 'package.json'),
JSON.stringify(pkgJson)
)
let { stdout } = await execa('yarn', ['--force'], { cwd: tmpdir })
await fs.writeFile(path.join(tmpdir, '.npmrc'), 'node-linker=hoisted')
Copy link
Member

Choose a reason for hiding this comment

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

Should we add this to .npmrc permanently instead of writing here each time?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we only want this behavior for the dummy package that gets created as part of this postinstall, which is ephemeral and deleted after the run completes

Copy link
Member

@styfle styfle Jul 24, 2023

Choose a reason for hiding this comment

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

@ztanner Can we use pnpm install --force --shamefully-hoist instead so the file is not needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

@styfle unfortunately not, it does not seem to have the same behavior as node-linker=hoisted

let { stdout } = await execa('pnpm', ['install', '--force'], {
cwd: tmpdir,
})
console.log(stdout)
let pkgs = await fs.readdir(path.join(tmpdir, 'node_modules/@next'))
await fs.ensureDir(path.join(cwd, 'node_modules/@next'))
Expand Down