diff --git a/packages/core/server/src/plugin-manager/utils.ts b/packages/core/server/src/plugin-manager/utils.ts index 3a41244c4..829d3c322 100644 --- a/packages/core/server/src/plugin-manager/utils.ts +++ b/packages/core/server/src/plugin-manager/utils.ts @@ -70,11 +70,11 @@ export function getNodeModulesPluginDir(packageName: string) { export function getAuthorizationHeaders(registry?: string, authToken?: string) { const headers = {}; if (registry && !authToken) { - const npmrcPath = path.join(process.cwd(), '.npmrc'); + const npmrcPath = path.join(os.homedir(), '.npmrc'); const url = new URL(registry); let envConfig: Record = process.env; if (fs.existsSync(npmrcPath)) { - const content = fs.readFileSync(path.join(process.cwd(), '.npmrc'), 'utf-8'); + const content = fs.readFileSync(npmrcPath, 'utf-8'); envConfig = { ...envConfig, ...ini.parse(content),