包管理工具
#查看包管理工具设置yarn config listnpm config list#全局安装过的包npm list -gnpm list -g --depth 0#全局可升级的包npm -g outdatednpx -p node@12(版本号,可以是大版本也可以是指定版本)#清除缓存npm cache verifynpm cache clear --forceyarn cache clean# 清除PowerShell历史alt+f7
npm 切换源
#包管理工具原有数据源npm config set registry https://registry.npmjs.orgyarn config set registry https://registry.yarnpkg.com#淘宝源npm config set registry https://registry.npmmirror.comyarn config set registry https://registry.npmmirror.com#个别包设置源npm config set electron_mirror https://npmmirror.com/mirrors/electron/npm config set sass_binary_site https://npmmirror.com/mirrors/node-sass/yarn config set electron_mirror https://npmmirror.com/mirrors/electron/yarn config set sass_binary_site https://npmmirror.com/mirrors/node-sass/
Node版本切换
node库下载链接:https://nodejs.org/download/release
nvm下载链接:https://github.com/coreybutler/nvm-windows/releases
#需要管理员权限#查看已安装node版本nvm ls# 安装对应版本的nodenvm install v版本号# 卸载对应版本的nodenvm uninstall xxx# 选择使用版本nvm use xxx
安装 Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew操作
// 要获取最新的包的列表brew outdated// 更新所有的包brew upgrade// 更新指定的包brew upgrade $FORMULA// 清理所有包的旧版本brew cleanup// 清理指定包的旧版本brew cleanup $FORMULA// 查看可清理的旧版本包,不执行实际操作brew cleanup -n// 查看已安装的包的依赖,树形显示brew deps --installed --tree// 显示安装了包数量,文件数量,和总占用空间brew info
安装软件npm
brew install gitbrew install nodebrew install yarnnpm i -g eslint
生成ssh
ssh-keygen -t rsa -C "you9009@foxmail.com"
打开ssh
open ~/.ssh
修改环境变量
// 创建文件touch ~/.bash_profile// 打开文件open -t ~/.bash_profile// 运行文件,使配置生效:source ~/.bash_profile// 检查是否生效:echo $PATH
新建文件夹/文件
mkdir nametouch name
