公告

👇👇👇扫我

图片
Skip to content

开发环境配置

1 切换 npm 源

查看源 npm get registry

json
{
  "use:npm": "npm config set registry https://registry.npmjs.org/",
  "use:taobao": "npm config set registry https://registry.npm.taobao.org",
  "use:ali": "npm config set registry https://registry.npmmirror.com/",
  "use:pnpmTaobao":"pnpm set registry https://registry.npm.taobao.org/",
  "clean":"pnpm store prune",
  "clean":"npm cache clean --force"
}

报错:Error: error:0308010C:digital envelope routines::unsupported

shell
set NODE_OPTIONS=--openssl-legacy-provider

netstat -ano|findstr 端口

bat
taskkill /pid 进程号 /f

2 我的 vscode 配置

json
{
  "eslint.codeAction.disableRuleComment": {},
  "gitee.gist": "0x23wrokzviy5tf6bd1nu27",
  "gitee.access_token": "3d0a8013d3f832ddb35eb0722e2064d8",
  "[javascript]": {
    // 设置特定语言在保存时自动格式化
    "editor.formatOnSave": false
  },
  "code-runner.runInTerminal": true,
  "files.autoGuessEncoding": true,
  "javascript.updateImportsOnFileMove.enabled": "always",
  "tabnine.experimentalAutoImports": true,
  "powermode.enabled": true,
  "powermode.shake.intensity": 0,
  "launch": {
    "configurations": [],
    "compounds": []
  },
  // 翻译
  "translate.youdao.appSecret": "ibMs16YdJdfM7bsh2QBGbs7pP18zw85W",
  "translate.youdao.appKey": "1e6e91edc0b76729",
  "json.schemas": [],
  "git.suggestSmartCommit": false,
  "vetur.format.options.useTabs": true,
  "vetur.completion.autoImport": false,
  "prettier.printWidth": 200,
  "prettier.tabWidth": 2,
  // vetur configuration
  "vetur.format.defaultFormatter.html": "js-beautify-html",
  "volar.splitEditors.layout.right": ["template", "customBlocks"],
  "typescript.validate.enable": true,
  "git.confirmSync": false,
  "git.autofetch": true,
  "git.autofetchPeriod": 600,
  "explorer.confirmDragAndDrop": false,
  "explorer.confirmDelete": false,
  "[json]": {
    "editor.quickSuggestions": {
      "strings": true
    },
    "editor.suggest.insertMode": "replace",
    "gitlens.codeLens.scopes": ["document"]
  },
  "window.zoomLevel": 1,
  "bracketPairColorizer.depreciation-notice": false,
  "timeline.excludeSources": ["timeline.localHistory"],
  "settingsSync.ignoredExtensions": [],
  "workbench.colorTheme": "Default Light+",
  "eslint.alwaysShowStatus": true,
  "eslint.validate": ["javascript", "ts", "typescript", "html", "vue"],
  "editor.mouseWheelZoom": true,
  "editor.tabSize": 2,
  "editor.codeActionsOnSave": {
    // 保存时自动修复
    "source.fixAll": true, //TODO
    "source.fixAll.eslint": true //TODO
  },
  "editor.formatOnPaste": true,
  "editor.formatOnType": true,
  "html.format.contentUnformatted": "",
  "editor.formatOnSave": true,
  "eslint.format.enable": true,
  "eslint.options": {
    //指定vscode的eslint所处理的文件的后缀
    "extensions": [".js", ".vue", ".ts", ".tsx"]
  },
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "editor.fontLigatures": false,
  "gitlens.proxy": {},
  "settingsSync.ignoredSettings": []
}

设置 git 全局信息设置

git config --global --list
git config --global user.name xxx
git config --global user.email xxx

git 快速解决冲突

1 安装 beyond compare
2 git 配置
git config --local merge.tool bc3
git config --local mergetool.path '/usr/local/bin/bcomp'
git config --local mergetool.keepBackup false

3 应用 beyond compare 解决冲突
git mergetool

volta node 版本管理

地址
https://github.com/volta-cli/volta/releases/download/v1.0.6/volta-1.0.6-windows-x86_64.msi

安装
volta install node@16 || node@14 || node@latest

切版本
volta pin node@16

常用
volta list //查看当前环境的版本
volta list all //查看存在的所有版本
volta install node //安装最新版的nodejs
volta install node@12.2.0 //安装指定版本
volta install node@12 //volta将选择合适的版本安装
volta pin node@10.15 //将更新项目的package.json文件以使用工具的选定版本
volta pin yarn@1.14 //将更新项目的package.json文件以使用工具的选定版本
阅读量: 0
评论量: 0