Skip to content

Commit 8d5f880

Browse files
hoxyqfacebook-github-bot
authored andcommitted
save registry auth token before bootstrapping verdaccio (#35991)
Summary: Pull Request resolved: #35991 Changelog: [Internal] While cherry-picking all this logic to `0.71-stable` branch, we've discovered several issues where some packages were failing to be published on Verdaccio proxy This was failing only on node v16+, after some research, I've noticed that there might be a race-condition and npm unable to grab this token before first `npm publish` executes Although this still work well on `main` branch, I am backporting it to keep aligned with `0.71-stable` Reviewed By: christophpurrer, cortinico Differential Revision: D42806081 fbshipit-source-id: af244d26ea529e6085ed5b2d731623dfaf78a14d
1 parent fac7859 commit 8d5f880

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/setup-verdaccio.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ function setupVerdaccio(
2828
);
2929
}
3030

31+
execSync('echo "//localhost:4873/:_authToken=secretToken" > .npmrc', {
32+
cwd: reactNativeRootPath,
33+
});
34+
3135
const verdaccioProcess = spawn(
3236
'npx',
3337
['verdaccio@5.16.3', '--config', verdaccioConfigPath],
@@ -37,11 +41,7 @@ function setupVerdaccio(
3741
const VERDACCIO_PID = verdaccioProcess.pid;
3842

3943
execSync('npx wait-on@6.0.1 http://localhost:4873');
40-
4144
execSync('npm set registry http://localhost:4873');
42-
execSync('echo "//localhost:4873/:_authToken=secretToken" > .npmrc', {
43-
cwd: reactNativeRootPath,
44-
});
4545

4646
return VERDACCIO_PID;
4747
}

0 commit comments

Comments
 (0)