This article introduces how to install and configure Chocolatey on Windows 11, and how to use it. We’ll install it via Powershell, and finally test by installing node.js on Windows 11 to make it usable. You can also install other programming languages and development environments such as Python, git, and Ruby, as well as libraries.
Install Chocolatey on Windows 11. Open Powershell with administrator privileges and execute the following command. To open Powershell with administrator privileges, right-click the powershell icon in the taskbar, right-click again, and select “Run as administrator”.
> Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
If the following is displayed, the installation has completed successfully.
“Chocolatey (choco.exe) is now ready”

You can verify that the installation was successful by outputting the version.
> choco --version
0.11.3
Execute the refreshenv command.
> refreshenv
Refreshing environment variables from registry for cmd.exe. Please wait...Finished..
At this point, various programming languages, development environments, libraries, and software that can be used with choco are now installable.
From here, let’s test by installing node.js on Windows 11 using choco.
Verify that node.js is not installed with the get-command command.
> Get-Command node
Get-Command : The term 'node' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Install the latest version of node.js with the following command.
> choco install nodejs -y
> choco install nodejs -y
Chocolatey v0.11.3
Installing the following packages:
nodejs
By installing, you accept licenses for the packages.
Progress: Downloading nodejs.install 17.0.1... 100%
Progress: Downloading nodejs 17.0.1... 100%
nodejs.install v17.0.1 [Approved]
nodejs.install package files install completed. Performing other installation steps.
Installing 64 bit version
Installing nodejs.install...
nodejs.install has been installed.
nodejs.install may be able to be automatically uninstalled.
Environment Vars (like PATH) have changed. Close/reopen your shell to
see the changes (or in powershell/cmd.exe just type `refreshenv`).
The install of nodejs.install was successful.
Software installed as 'msi', install location is likely default.
nodejs v17.0.1 [Approved]
nodejs package files install completed. Performing other installation steps.
The install of nodejs was successful.
Software install location not explicitly set, it could be in package or
default install location of installer.
Chocolatey installed 2/2 packages.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
> echo $?
True

At this point, node.js installation is complete, but note that you cannot use the command until you restart the console. For example, if you’re running powershell.exe, close that window and open a new one. If you’re using conemu, close conemu and open it again. Or opening a new instance is also fine.
On the command line of the new instance console, verify the node.js version with the following command.
> node -v
v17.0.1
Try Hello world with node.js.
> node -e 'console.log(`"Hello World...`")'
Hello World...

Note that the above command is for execution in powershell. In WSL Bash or cmd.exe, the escape sequences are different, so it will probably error. (Example below)
[eval]:1
console.log(Hello World...)
^^^^^
SyntaxError: missing ) after argument list