From 6f3b3f9a93ea75e9af2926977917ec8f970be40d Mon Sep 17 00:00:00 2001 From: Dhai Date: Fri, 27 Dec 2024 21:00:41 +0530 Subject: [PATCH] add warning if using npm as fallback --- packages/create-fuels/src/lib/getPackageManager.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/create-fuels/src/lib/getPackageManager.ts b/packages/create-fuels/src/lib/getPackageManager.ts index f4893d37c9..fcbc60fc84 100644 --- a/packages/create-fuels/src/lib/getPackageManager.ts +++ b/packages/create-fuels/src/lib/getPackageManager.ts @@ -1,3 +1,5 @@ +import { warn } from '../utils/logger'; + export const availablePackageManagers = ['pnpm', 'npm', 'bun'] as const; export type PackageManager = (typeof availablePackageManagers)[number]; @@ -42,6 +44,12 @@ export function getUserPkgManager(): PackageManager { return packageMangers.bun.name; } + if (userAgent.startsWith(packageMangers.npm.name)) { + return packageMangers.npm.name; + } + + warn(`This package manager is not supported. Using npm instead.`); + return packageMangers.npm.name; }