echo $PATH 查看环境变量
Cmd + Shift +. 查看隐藏文件
.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)" homebrew配置
alias python="/opt/homebrew/bin/python3.9" 制定默认为python3.9
export PATH=/opt/homebrew/Cellar/composer/2.1.3/bin:$PATH
zsh --version 查看zsh版本
omz update
which php 查看PHP安装位置 php -V /opt/homebrew/bin/php 里面的PHP是映射
/opt/homebrew/Cellar/php/8.1.4/bin/php 安装路径
npm install -g @vue/cli
vue --version(查看vue脚手架版本) @vue/cli 5.0.4
npm update -g @vue/cli 升级全局脚手架版本
yarn global add @vue/cli
yarn --version (查看yarn版本) 1.22.18
yarn global upgrade --latest @vue/cli 升级全局脚手架版本
brew install node 安装node后自动安装npm
node --version
npm install npm -g 更新全局安装npm npm install -g npm@8.13.2
npm view 包名 versions 查看包的版本
npm --version npm -v 查看npm版本8.5.5查看所有全局安装的模块
npm list -g
nrm是npm的镜像源管理工具 npm install -g nrm
nrm ls 查看可选的源
nrm use taobao 切换源
nrm test 测试相应源的响应时间
nrm add registry http://registry.npm.frp.trmap.cn/
nrm del registry http://registry.npm.frp.trmap.cn/
npm----/opt/homebrew/lib/node_modules. 全局安装路径 npm list -g
npm -v
npm config list 查看npm配置
npm search 包名 搜索npm厂库中的模块
npm list 当前项目所以模块
npm list --depth 0 -g 全局安装的模块
npm i xx -g 全局安装模块 vue@cli
npm view jquery versions 查看jquery所有的版本
npm init 初始化
npm update xxx 怎么安装的这么升级
npm i -g nrm
nrm ls
nrm use taobao
nrm add registry 地址
nrm test npm
yarn coinfig
yarn config set key value # 设置
npm config set key value
yarn config get key # 读取值
npm config get key
yarn config delete key # 删除
npm config delete key
yarn config list # 显示当前配置
npm config list
yarn config set registry https://registry.npm.taobao.org # 设置淘宝镜像
sudo yarn global list # 列出全局安装的模块
1.安装brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
需要翻墙才能下载clash 建议使用官方的方法,
不要翻墙的网上看的没试过
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
2.brew 常用命令 brew install node yarn 然后用npm yarn 管理自己的包
brew list------查看软件安装列表
brew install 包名 ------安装软件
brew services list -------查看所有服务列表
brew services start(stop restart) 包名 开启服务
brew info 包名 -----查看当前软件安装信息
brew uninstall 包名 -----卸载
brew search 包名 搜索可用安装包
3.yarn global add yrm 或者 npm install -g yrm
4.npm install -g koa-generator
5.这两个我都安装了,没有安装yarn 你创建vue报错我没法解决,网上一些办法试过,效果没有
6.vue -V 产看@vue/cli 版本 vue create deom 成功创建 完成后 选择npm or yarn 创建没有问题
yarn global add @vue/cli
# OR
npm install -g @vue/cli
7.vue create 项目名 -----创建Vue项目
8.
koa2 test
cd test
npm i
9.vue 版本升级
npm update -g @vue/cli
yarn global upgrade -- latest @vue/cli
10.vite 创建
npm init vite@latest my-vue-app
node node_modules/esbuild/install.js 然后就可以运行了 是esbuild的一个bug
vuex@next
npm install vue-router@4
11.
yarn create vite my-vue-app
cd my-vue-app
yarn
yarn dev 跑起来了
https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/ 清华源
换成清华源
$ cd /usr/local/Homebrew
$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
$ cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
$ git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
$ brew update
$ cd "$(brew --repo)"
$ git remote set-url origin https://github.com/Homebrew/brew.git
$ cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
$ git remote set-url origin https://github.com/Homebrew/homebrew-core
$ brew update
"$(brew --repo)" 这里填/usr/local/Homebrew
brew -v 查看homebrew安装版本
brew --help 简洁命令帮助
man brew 完整命令帮助
brew search git 搜索软件包
brew install git 安装软件包
brew uninstall git 卸载安装包
brew list 显示已安装的所有软件包
brew list git 查看安装软件包的安装地址
brew pin git 锁定不想更新的软件包
brew unpin git 取消锁定不想更新的软件包
brew outdated 查看已安装的哪些软件包需要更新以及更新情况
brew update 同步远程最新更新情况,对本机已经安装并有更新的软件用*标明
brew upgrade git 更新单个软件包
brew info git 查看软件包信息
brew home git 访问软件包的官方网站
brew cleanup -n 查看可清理的旧版本包,不执行实际操作
brew cleanup 清理所有已安装软件包的历史版本
brew cleanup git 清理单个已安装软件包的历史版本
mkdir 文件夹名
touch 文件名 创建文件
rmdir 删除文件()名
sudo 使用root权限运行
有时候升级环境变量会被清除,一般写在 .zshrc 中就没问题
vim ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)" alias python="/opt/homebrew/bin/python3.9"vim ~/.zshrc
export PATH=/opt/homebrew/Cellar/composer/2.1.3/bin:$PATH export PATH=~/.composer/vendor/bin:$PATH
3921

被折叠的 条评论
为什么被折叠?



