配置环境-git yarn

1.安装vscode

2.安装git bash

  1.         2.1在系统应用中以管理员身份运行git bash 或者git bash所在文件夹中双击打开git-cmd.exe
    1.         2.2清空所有用户名和密码:git config --system --unset credential.helper
      1.         2.3.先输git config --global user.email “你的邮箱号
        1.         2.4.再输git config --global user.name “账号名
        2. [

          局部配置,针对具体项目,在项目目录下运行命令:

          git config user.name "worker95"

          git config user.email "worker95@work.com"

          全局配置:

          git config --global user.name "user95"

          git config --global user.email "user95@foxmail.com"

          ]
          1.         2.5 补充 如果不想每次输入用户和密码(可以使用git config --global credential.helper store,这样再获取代码提示输入用户名和密码,输入之后后续就不需要再次输入了。
            1.         2.6淘宝镜像 :npm install -g cnpm --registry=http://registry.npmmirror.com
  2. 3.安装yarn

    1.         3.1vscode命令行中 npm install -g yarn            
  3. (这个安装成功后有目录 找到bin C:\Users\Administrator\AppData\Local\Yarn\bin)
    1.        3.2配置path中的环境变量
      1.        3.3yarn config set registry xxxxxx   (看是否需要配置)
        1.        3.4重启vscode
        2. 4.在vscode中无法使用yarn

          1.         4.1 在vscode终端中使用  get-ExecutionPolicy
            1.         4.2显示Restricted(不可用,继续操作)
              1.         4.3输入 set-ExecutionPolicy RemoteSigned
                1.         4.4输入 set-ExecutionPolicy –Scope CurrentUser
                  1.         4.5设置: RemoteSigned
                    1.         4.6重启vscode
                    2. 5.host 文件地址 C:\Windows\System32\drivers\etc

                  2. # Copyright (c) 1993-2009 Microsoft Corp.
                    #
                    # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
                    #
                    # This file contains the mappings of IP addresses to host names. Each
                    # entry should be kept on an individual line. The IP address should
                    # be placed in the first column followed by the corresponding host name.
                    # The IP address and the host name should be separated by at least one
                    # space.
                    #
                    # Additionally, comments (such as these) may be inserted on individual
                    # lines or following the machine name denoted by a '#' symbol.
                    #
                    # For example:
                    #
                    #      102.54.94.97     rhino.acme.com          # source server
                    #       38.25.63.10     x.acme.com              # x client host
                    
                    # localhost name resolution is handled within DNS itself.
                    #	::1             localhost
                    127.0.0.1       localhost
                    localhost  127.0.0.1
                    #127.0.0.1  wxp.56pay.net    配置可以参考这个
                    127.0.0.1 view-localhost # view localhost server
                    

yarn 其他常遇问题:

1.yarn : 无法加载文件 C:\Program Files\nodejs\yarn.ps1,因为在此系统上禁止运行脚本

cmd 下执行 Set-ExecutionPolicy -Scope CurrentUser
输入 remotesigned

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值