Why not WinGet instead of WSL>nvm or nvm-windows? #868
-
npm Docs says:
I'm not going to use multiple versions of node so the only reason I have to use a Node Version Manager would be to get node/npm installed properly. After carefully reading everything about npm and nvm, I see that in order to use nvm I'd have to use WSL. For those keeping score, we're now two superfluous steps removed from the goal, getting node/npm installed properly. Reading about WSL, I suspect that WSL>nvm will lock me into using node/npm inside a Linux environment, further complicating things. There's also nvm-windows which points out that it's only similar to nvm, so going that route would require remaining diligent whenever I read instructions for nvm. At first I confused wget (for installing nvm on Linux) with WinGet (github) and spent time researching whether nvm's install.sh was cross-platform and could be run in PowerShell. I concluded it's not, hence WSL and nvm-windows. When I realized wget was not winget, I decided to see if I could just cut out all the middlemen steps. PS C:\Users> winget search npm; ""
Name Id Version Match Source
-----------------------------------------------------------------
Volta Volta.Volta 1.1.1 Command: npm winget
Node.js Nightly OpenJS.NodeJS.Nightly 20.0.0 Command: npm winget
Node.js OpenJS.NodeJS 19.6.0 Command: npm winget
pnpm pnpm.pnpm 7.27.0 Tag: npm winget
Node.js LTS OpenJS.NodeJS.LTS 18.14.0 Tag: npm winget
Nodist Nodist.Nodist 0.9.1.0 Tag: npm winget
ndm 720kb.ndm 1.2.0 Tag: npm winget
PS C:\Users> winget show "Node.js LTS"
Found Node.js LTS [OpenJS.NodeJS.LTS]
Version: 18.14.0
Publisher: Node.js Foundation
Publisher Url: https://nodejs.org
Publisher Support Url: https://github.com/nodejs/help/issues
Author: OpenJS Foundation
Moniker: nodejs-lts
Description: Node.js is a JavaScript runtime built on Chrome"s V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js" package ecosystem, npm, is the largest ecosystem of open source libraries in the world.
Homepage: https://nodejs.org
License: Copyright Joyent, Inc. and other Node contributors. All rights reserved.
License Url: https://raw.githubusercontent.com/nodejs/node/v16.4.1/LICENSE
Release Notes Url: https://github.com/nodejs/node/releases/tag/v18.14.0
Tags:
cross-platform
foss
javascript
lts
node
nodejs
npm
Installer:
Installer Type: wix
Installer Locale: en-US
Installer Url: https://nodejs.org/dist/v18.14.0/node-v18.14.0-x64.msi
Installer SHA256: 944eff6104be19d1dc24f3940ab365aa972c47ee2a6b7cfee49dd436e748bd99 In the end, Does npm Docs' warning about Node installers putting npm in a directory with local permissions only apply to Linux? Why not run PowerShell as administrator (of course) and use WinGet, or (seemingly equivalent) download the .msi and run it as administrator? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
If you're using more than one version of node across all time, you're using multiple versions of node. In the fullness of time, this means that literally everyone is always using multiple versions of node. On windows, to use nvm, you'd need WSL 2, or cygwin, or git-bash. |
Beta Was this translation helpful? Give feedback.
If you're using more than one version of node across all time, you're using multiple versions of node. In the fullness of time, this means that literally everyone is always using multiple versions of node.
On windows, to use nvm, you'd need WSL 2, or cygwin, or git-bash.