Skip to content

Commit e96402e

Browse files
committed
docs: Add winget as a listed way to install Node.js
1 parent 01ffa2a commit e96402e

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

apps/site/i18n/locales/en.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,9 @@
310310
"homebrewIsNotNodejsPackageManager": "Homebrew is not a Node.js package manager.",
311311
"homebrewInstructions": "Follow official instructions at https://brew.sh/",
312312
"homebrewSupportsIntallingMajorNodejsVersion": "Homebrew only supports installing major Node.js versions and might not support the latest Node.js version from the {version} release line.",
313+
"wingetIsNotNodejsPackageManager": "The Windows Package Manager is not a Node.js package manager.",
314+
"wingetInstructions": "Follow official instructions at https://learn.microsoft.com/en-us/windows/package-manager/winget/install",
315+
"wingetNotMaintainedByNodejs": "Winget is not officially maintained by the Node.js project and might not support the {version} version of Node.js",
313316
"chocolateyIsNotNodejsPackageManager": "Chocolatey is not a Node.js package manager.",
314317
"chocolateyInstructions": "Follow official instructions at https://chocolatey.org/",
315318
"chocolateyNotMaintainedByNodejs": "Chocolatey is not officially maintained by the Node.js project and might not support the {version} version of Node.js"

apps/site/types/release.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { ReactNode } from 'react';
33
import type { NodeRelease } from '@/types/releases';
44
import type { UserOS } from '@/types/userOS';
55

6-
export type PackageManager = 'NVM' | 'FNM' | 'BREW' | 'DOCKER' | 'CHOCO';
6+
export type PackageManager = 'NVM' | 'FNM' | 'BREW' | 'DOCKER' | 'WINGET' | 'CHOCO';
77

88
export interface ReleaseState {
99
os: UserOS;

apps/site/util/downloadUtils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ export const platformItems = [
4949
label: PackageManagerLabel.BREW,
5050
value: 'BREW' as PackageManager,
5151
},
52+
{
53+
label: PackageManagerLabel.WINGET,
54+
value: 'WINGET' as PackageManager,
55+
},
5256
{
5357
label: PackageManagerLabel.CHOCO,
5458
value: 'CHOCO' as PackageManager,

apps/site/util/getNodeDownloadSnippet.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export const getNodeDownloadSnippet = (
1515
FNM: '',
1616
BREW: '',
1717
DOCKER: '',
18+
WINGET: '',
1819
CHOCO: '',
1920
};
2021

@@ -84,6 +85,22 @@ export const getNodeDownloadSnippet = (
8485
}
8586

8687
if (os === 'WIN') {
88+
snippets.WINGET = dedent`
89+
# ${t('layouts.download.codeBox.noteWithColon')}
90+
# ${t('layouts.download.codeBox.wingetIsNotNodejsPackageManager')}
91+
# ${t('layouts.download.codeBox.PleaseEnsureAlreadyInstallOnSystem')}
92+
# ${t('layouts.download.codeBox.wingetInstructions')}
93+
# ${t('layouts.download.codeBox.wingetNotMaintainedByNodejs', { version: release.versionWithPrefix })}
94+
95+
# ${t('layouts.download.codeBox.downloadAndInstallNodejs')}
96+
winget install -e --id OpenJS.NodeJS${release.isLts ? '.LTS' : ''} -v ${release.major}
97+
98+
# ${t('layouts.download.codeBox.verifiesRightNodejsVersion')}
99+
node -v # ${t('layouts.download.codeBox.shouldPrint', { version: release.versionWithPrefix })}
100+
101+
# ${t('layouts.download.codeBox.verifiesRightNpmVersion')}
102+
npm -v # ${t('layouts.download.codeBox.shouldPrint', { version: release.npm })}`;
103+
87104
snippets.FNM = dedent`
88105
# ${t('layouts.download.codeBox.installsFnm')}
89106
winget install Schniz.fnm

0 commit comments

Comments
 (0)