{"record":{"id":"d5d4baf9017f23cf","repo":"FuelLabs/fuels-ts","slug":"unsupported-platform-process-platform-process","errorCode":null,"errorMessage":"Unsupported platform ${process.platform}.${process.platform === 'win32' ? ' If you are on Windows, please use WSL.' : ''}","messagePattern":"Unsupported platform (.+?)\\.(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"internal/forc/lib/shared.js","lineNumber":39,"sourceCode":"};\n\nconst binaries = [\n  'forc',\n  'forc-crypto',\n  'forc-debug',\n  'forc-deploy',\n  'forc-doc',\n  'forc-fmt',\n  'forc-lsp',\n  'forc-migrate',\n  'forc-run',\n  'forc-submit',\n  'forc-tx',\n];\n\nexport const getPkgPlatform = () => {\n  if (process.platform !== 'darwin' && process.platform !== 'linux') {\n    throw new Error(\n      `Unsupported platform ${process.platform}.${\n        process.platform === 'win32' ? ' If you are on Windows, please use WSL.' : ''\n      }}`\n    );\n  }\n  if (process.arch !== 'arm64' && process.arch !== 'x64') {\n    throw new Error(`Unsupported arch ${process.arch}`);\n  }\n  return platforms[process.platform][process.arch];\n};\n\nexport const versionFilePath = join(__dirname, '../VERSION');\n\nexport const getCurrentVersion = () => {\n  const versionContents = readFileSync(versionFilePath, 'utf8');\n  const forcVersion = versionContents.match(/^.+$/m)?.[0] || versionContents;\n  return forcVersion;\n};","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/FuelLabs/fuels-ts/blob/b3f37c91aca4aa9d5e4c0d3967f66237190826ea/internal/forc/lib/shared.js#L21-L57","documentation":"Thrown by `getPkgPlatform()` in the forc installer when `process.platform` is neither `darwin` nor `linux`. The forc binaries are only published for macOS and Linux; Windows users must run under WSL. Fires during the forc postinstall before any download is attempted.","triggerScenarios":"Running `npm/pnpm/yarn install` on native Windows (platform `win32`), FreeBSD (`freebsd`), Solaris (`sunos`), or AIX (`aix`). The Windows branch appends a hint to use WSL.","commonSituations":"Developers on Windows who have not enabled/entered WSL; CI runners pinned to a Windows image without WSL; cross-platform Docker images built `FROM` a non-linux base.","solutions":["On Windows: install WSL2 (`wsl --install`), then run the install inside a WSL shell where `process.platform` reports `linux`.","On other unsupported OSes: run the build inside a Linux container (e.g. `ubuntu` image).","If you maintain a fork with extra binaries, extend the `platforms` map in `internal/forc/lib/shared.js` to include the new platform before calling `getPkgPlatform`."],"exampleFix":"// before (PowerShell on native Windows)\n$ pnpm install\n// throws: Unsupported platform win32. If you are on Windows, please use WSL.\n\n// after (WSL)\n$ wsl -d Ubuntu\n$ pnpm install","handlingStrategy":"validation","validationCode":"// gate before invoking the installer\nconst SUPPORTED_PLATFORMS = new Set(['darwin', 'linux']);\nif (!SUPPORTED_PLATFORMS.has(process.platform)) {\n  throw new Error(\n    `Refusing to install forc on ${process.platform}. Use WSL on Windows or a Linux/macOS host.`\n  );\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["On Windows, always run project setup inside WSL2; document this in your README.","Use a Linux/macOS Docker image for CI to guarantee `process.platform` is supported.","Detect the platform in a preinstall script and print an actionable message before the unsupported installer runs."],"tags":["install","forc","platform","windows","wsl","environment"],"backgroundTag":null,"analyzedSha":"b3f37c91aca4aa9d5e4c0d3967f66237190826ea","analyzedAt":"2026-08-12T20:30:56.448Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}