Skip to content

Commit 4205bc4

Browse files
committed
fix: pass npmRegistryServer to Yarn config
1 parent efd1cd0 commit 4205bc4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/template/initialize.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const {reactNativeRootPath, templateName, templateConfigPath, directory} = argv;
4343

4444
const REPO_ROOT = path.resolve(__dirname, '../..');
4545
const VERDACCIO_CONFIG_PATH = `${reactNativeRootPath}/.circleci/verdaccio.yml`;
46+
const NPM_REGISTRY_SERVER = 'http://localhost:4873';
4647

4748
async function install() {
4849
const VERDACCIO_PID = setupVerdaccio(
@@ -82,7 +83,7 @@ async function install() {
8283
process.stdout.write('Published every package \u2705\n');
8384

8485
execSync(
85-
`node cli.js init ${templateName} --directory ${directory} --template ${templateConfigPath} --verbose --skip-install`,
86+
`node cli.js init ${templateName} --directory ${directory} --template ${templateConfigPath} --verbose --skip-install --yarn-config-options npmRegistryServer="${NPM_REGISTRY_SERVER}"`,
8687
{
8788
cwd: `${reactNativeRootPath}/packages/react-native`,
8889
stdio: [process.stdin, process.stdout, process.stderr],
@@ -95,6 +96,12 @@ async function install() {
9596
cwd: directory,
9697
stdio: [process.stdin, process.stdout, process.stderr],
9798
};
99+
100+
execSync(
101+
`yarn config set npmRegistryServer="${NPM_REGISTRY_SERVER}"`,
102+
options,
103+
);
104+
98105
const success = await retry('yarn', options, 3, 500, ['install']);
99106

100107
if (!success) {

0 commit comments

Comments
 (0)