【vue】Mac上安装Node和NPM
第一步:进入node.js的官网
https://nodejs.org/en/download/package-manager
第二步:选择适合的安装包进行下载
选择适合你的macOS版本的安装程序。
- 如果你使用的是Intel芯片,请选择"macOS Installer";
- 如果你使用的是Apple Silicon芯片(M1芯片),请选择"macOS Universal Installer"。
# installs nvm (Node Version Manager) curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash # download and install Node.js (you may need to restart the terminal) nvm install 20 # verifies the right Node.js version is in the environment node -v # should print `v20.16.0` # verifies the right npm version is in the environment npm -v # should print `10.8.1`
第二步:确认安装成功
shangxiaofei@XXSHANG-MC0 ~ % nvm install 20 Downloading and installing node v20.16.0... Downloading https://nodejs.org/dist/v20.16.0/node-v20.16.0-darwin-arm64.tar.xz... ######################################################################### 100.0% Computing checksum with shasum -a 256 Checksums matched! Now using node v20.16.0 (npm v10.8.1) Creating default alias: default -> 20 (-> v20.16.0) shangxiaofei@XXSHANG-MC0 ~ % node -v v20.16.0 shangxiaofei@XXSHANG-MC0 ~ % npm -v 10.8.1 shangxiaofei@XXSHANG-MC0 ~ %