Build front-end development environment

  • Installation node. Js
    • The website addressnodejs.org/en/Select a package for the operating system to download
    • All the way next, be careful not to install on the system disk.
    • To check whether the installation is successful, run the node -v command to view the node version. The installation is successful, as shown in the following figure
  • Install the NPM
    • Before downloading, what is NPM? NPM is a package management tool for Node.js. Its purpose is that if we use code written by others, there will be some dependency packages introduced by others. If we download each package, it will be tedious and error prone. NPM makes it much easier for people to package their code and put it on NPM. No matter where your code is, you can download it anytime, anywhere. NPM has been installed during node installation. You can view the NPM version NPM -v as shown below
  • Git installed
    • Windows system

      • Download from git-scm.com/downloads download the installation program directly from the official website
      • Install it by default.
      • After the installation is complete, go to “Git” -> “Git Bash” in the Start menu, and a command-line window pops up.
    • MAC system

      • Git cannot be directly downloaded for a MAC system. You can install git using the following methods:
        1. Download XCode from the App Store. XCode is integrated with Git, but it is not installed by default. You need to run XCode, choose “XCode” -> “Preferences”, find “Downloads” in the pop-up window, select “Command Line Tools” and click “Install” to complete the installation.
        2. Install via Homebrew
          1. If homebrew is not installed, install it first
            /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
            Copy the code

          2. Use Homebrew to install Git and runbrew install git

    • Verify, if the following information is displayed, the installation is successful!

    • Configure git

      • git config –global user.name “Your Name”
      • git config –global user.email “[email protected]
    • Create a SSH key

      ssh-keygen -t rsa -C "[email protected]"
      Copy the code

      Because I’ve generated it before, I’m going to choose n, and I’m going to choose Y if I generated it the first time

    • Look at the key

      cat .ssh/id_rsa.pub
      Copy the code

    • Configuration keys

      1. Copy the SSH key above
      2. Go to Github and add a key.
    • If the following output is displayed, the system succeeds

      ssh -T [email protected] 
      Last login: Sat Jan  6 14:42:55 on ttys000
      WMBdeMacBook-Pro:~ WENBO$ ssh -T [email protected] 
      Hi wenmobo! You've successfully authenticated, but GitHub does not provide shell access.
      WMBdeMacBook-Pro:~ WENBO$ 
      Copy the code
    • Now you can pull the code to run normally!

      1. Find a Vue project on Github and copy the path shown in the diagram

        Git clone + git clone + git clone + git clone + git clone + git clone + git clone + git clone Contributes.vs Code To open the command palette (⇧⌘P), type shell Command, and invoke ‘code’ command in PATH.

      2. Run the project, generally look at the project’s readme file execution. Most VUE projects install dependencies first, NPM install/YARN, then run NPM run start/YARN run start.

** This article can not cover all situations, only for reference, thank you for your support! **