mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-13 02:55:56 -04:00
* fix(node.fetcher): node < 16 download fail on apple silicon Add a check for macos apple silicon and required node version < 16. In such case, download x64 binary. Because arm build does not exist. Previous behaviour: Try to download non existing arm build and fail with 404. NO breaking change fixes #4489 * refactor(node.fetcher): move code to normalizeArch
18 lines
573 B
TypeScript
18 lines
573 B
TypeScript
import normalizeArch from '../lib/normalizeArch'
|
|
|
|
test.each([
|
|
['win32', 'ia32', 'x86'],
|
|
['linux', 'arm', 'armv7l'], // Raspberry Pi 4
|
|
['linux', 'x64', 'x64'],
|
|
])('normalizedArch(%s, %s)', (platform, arch, normalizedArch) => {
|
|
expect(normalizeArch(platform, arch)).toBe(normalizedArch)
|
|
})
|
|
|
|
// macos apple silicon
|
|
test.each([
|
|
['darwin', 'arm64', '14.20.0', 'x64'],
|
|
['darwin', 'arm64', '16.17.0', 'arm64'],
|
|
])('normalizedArch(%s, %s)', (platform, arch, nodeVersion, normalizedArch) => {
|
|
expect(normalizeArch(platform, arch, nodeVersion)).toBe(normalizedArch)
|
|
})
|