Windows 下载配置NodeJs

160 阅读1分钟

小白开始入坑 Angular

首先配置NodeJs的环境, 打开NodeJs下载网站 nodejs.org/en/download…

选择Windows 环境, fnm

installs fnm (Fast Node Manager)

winget install Schniz.fnm

PS: 1. PowerShell 下载需要在这里额外配置一项 fnm completions --shell power-shell,否则会报错. 2. 找到这个文件,没有就创建一个 C:\Users\XXX\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 fnm env --use-on-cd | Out-String | Invoke-Expression 把这段代码写到ps1文件中。

error: We can't find the necessary environment variables to replace the Node version. You should setup your shell profile to evaluate fnm env, see github.com/Schniz/fnm#… on how to do this Check out our documentation for more information: fnm.vercel.app

download and install Node.js

fnm use --install-if-missing 20

verifies the right Node.js version is in the environment

node -v # should print v20.15.0

verifies the right NPM version is in the environment

npm -v # should print `10.7.0``

配置完成