diff --git a/scripts/link-in-app.ts b/scripts/link-in-app.ts index c7e1d5f6..c50bbdbe 100644 --- a/scripts/link-in-app.ts +++ b/scripts/link-in-app.ts @@ -2,6 +2,7 @@ import { execSync } from "child_process"; import { join as pathJoin, relative as pathRelative } from "path"; import { getThisCodebaseRootDirPath } from "../src/bin/tools/getThisCodebaseRootDirPath"; import * as fs from "fs"; +import * as os from "os"; const singletonDependencies: string[] = ["react", "@types/react"]; @@ -83,7 +84,9 @@ const execYarnLink = (params: { targetModuleName?: string; cwd: string }) => { cwd, env: { ...process.env, - HOME: yarnGlobalDirPath + ...(os.platform() === "win32" + ? { USERPROFILE: yarnGlobalDirPath } + : { HOME: yarnGlobalDirPath }) } }); };