安装软件MacOS
2025-04-08 14:51阅读:163评论:0
brew安装node
以安装node14为例 breww 安装node 使用 n 切换版本无效,去官网下载pkg 安装包没有这个问题 安装brew install node\@14 卸载brew uninstall node\@14 当执行brew install node\@14命令。下载安装完成后会提升如下 意思是想
_PROTECTED0__
breww 安装node 使用 n 切换版本无效,去官网下载pkg 安装包没有这个问题
- 安装brew install node\@14
- 卸载brew uninstall node\@14
- 当执行brew install node\@14命令。下载安装完成后会提升如下
1
2
3
4
5
6
7
If you need to have node\@14 first in your PATH, run:echo 'export PATH="/usr/local/opt/node\@14/bin:\$PATH"' >> \~/.zshrc For compilers to find node\@14 you may need to set:export LDFLAGS="-L/usr/local/opt/node\@14/lib"export CPPFLAGS="-I/usr/local/opt/node\@14/include" - 意思是想让你配置node的环境变量,不然node的命令无法使用
1
2
3
4
5
$ echo 'export PATH="/usr/local/opt/node@14/bin:$PATH"' >> ~/.zshrc$ echo 'export LDFLAGS="-L/usr/local/opt/node@14/lib"' >> ~/.zshrc$ echo 'export CPPFLAGS="-I/usr/local/opt/node@14/include"' >> ~/.zshrc$ source ~/.zshrc _PROTECTED0_PROTECTED2_PROTECTED1__
1
2
3
4
首先设置npm或者yarn镜像为淘宝镜像 详情: 淘宝 NPM 镜像npm config set registry https://registry.npm.taobao.orgyarn config set registry https://registry.npm.taobao.org