Puppeteer: Cannot detect the browser platform for: {value} ({value})
The browser installer cannot map the current OS/CPU pair to a supported binary platform.
The browser installer cannot map the current OS/CPU pair to a supported binary platform.
Error message
Cannot detect the browser platform for: {value} ({value})
{value} is replaced by the value shown in your error message.
How this error happens
Browser uninstallation also needs the artifact’s platform. On an unsupported host, omitting that platform makes the browser manager unable to identify the cache entry.
The failing snippet assumes automatic platform detection fails. The fix continues with the imported uninstall and Browser.
import {
Browser,
uninstall,
} from "@puppeteer/browsers";
await uninstall({
cacheDir: "/absolute/path/browser-cache",
browser: Browser.CHROME,
buildId: "example-build",
});
How to fix
Pass the platform of the exact cache entry you intend to remove.
import {
BrowserPlatform,
} from "@puppeteer/browsers";
await uninstall({
cacheDir: "/absolute/path/browser-cache",
browser: Browser.CHROME,
platform: BrowserPlatform.LINUX,
buildId: "example-build",
});
Things to keep in mind
uninstall deletes that browser installation. Replace the example build and platform with a verified unused entry; do not run this against a browser currently in use.