FuelLabs/fuels-ts · error · Error

Unsupported platform ${process.platform}.${process.platform

Error message

Unsupported platform ${process.platform}.${process.platform === 'win32' ? ' If you are on Windows, please use WSL.' : ''}

What it means

Thrown by `getPkgPlatform()` in the fuel-core installer when `process.platform` is not `darwin` or `linux`. The fuel-core binaries are published only for macOS and Linux; Windows requires WSL. Identical guard shape to the forc installer.

Source

Thrown at internal/fuel-core/lib/shared.js:33

export const __dirname = dirname(fileURLToPath(import.meta.url));

export const fuelCoreBinDirPath = join(__dirname, '..', 'fuel-core-binaries');
export const binPath = join(fuelCoreBinDirPath, 'fuel-core');

const platforms = {
  darwin: {
    arm64: 'aarch64-apple-darwin',
    x64: 'x86_64-apple-darwin',
  },
  linux: {
    arm64: 'aarch64-unknown-linux-gnu',
    x64: 'x86_64-unknown-linux-gnu',
  },
};

export const getPkgPlatform = () => {
  if (process.platform !== 'darwin' && process.platform !== 'linux') {
    throw new Error(
      `Unsupported platform ${process.platform}.${
        process.platform === 'win32' ? ' If you are on Windows, please use WSL.' : ''
      }`
    );
  }
  if (process.arch !== 'arm64' && process.arch !== 'x64') {
    throw new Error(`Unsupported arch ${process.arch}`);
  }
  return platforms[process.platform][process.arch];
};

export const versionFilePath = join(__dirname, '../VERSION');

export const getCurrentVersion = () => {
  const fuelCoreVersion = readFileSync(versionFilePath, 'utf8');
  return fuelCoreVersion.trim();
};

View on GitHub (pinned to b3f37c91ac)

Solutions

  1. On Windows, run the install under WSL2 so `process.platform === 'linux'`.
  2. On other unsupported OSes, perform the install inside a Linux container.
  3. Fork path: extend the `platforms` map in `internal/fuel-core/lib/shared.js` and publish your own fuel-core builds.

Example fix

// before (Windows PowerShell)
$ pnpm install
// throws: Unsupported platform win32. If you are on Windows, please use WSL.

// after (WSL)
$ wsl -d Ubuntu
$ pnpm install
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED_PLATFORMS = new Set(['darwin', 'linux']);
if (!SUPPORTED_PLATFORMS.has(process.platform)) {
  throw new Error(`Refusing to install fuel-core on ${process.platform}; use WSL on Windows.`);
}

Prevention

When it happens

Trigger: Running the fuel-core postinstall on `win32` (native Windows), `freebsd`, `sunos`, `aix`, etc. The Windows case appends a WSL hint.

Common situations: Native Windows development without WSL; Windows-based CI images; niche UNIX environments without published fuel-core binaries.

Related errors


AI-assisted analysis of FuelLabs/fuels-ts@b3f37c91ac (2026-08-12). Data as JSON: /api/errors/a354ad382f64a835. Report an issue: GitHub.