How to start Vue project with M1 pro chip

How to start Vue project with M1 pro chip

introduction

I bought a MacBook Pro with m1 pro during the Singles Day shopping spree. All the environments need to be set up again. The backend project is relatively easy, I can just install idea and start it. I am not very familiar with the frontend Vue, so I did some research, built the environment and started Vue.

Install Homebrew

Homebrew is a great tool for managing software installation on Mac, so I installed Homebrew as soon as I got the Mac. The installation may fail due to network reasons. The following command can be used to use a domestic mirror, which makes the installation faster.

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

After entering 1, follow the prompts to install it step by step.

Install nvm

Nvm is a tool for managing Node versions. When there are more projects, you will always need to switch the Node environment, so it is recommended that you use Nvm to install Node. It can be installed by the following command.

brew install nvm

After the installation is complete, you need to configure the environment variables. Edit the .bash_profil configuration file using the command below.

vi ~/.bash_profile

Write the following configuration script into the file.

export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

After writing, you need to make the configuration take effect. Execute the following command.

source ~/.bash_profile

Install Node

Next, install Node through nvm. The node version adapted to the M1 pro chip is v15.

nvm i v15

After the command is run, it will take a long time to compile node. Please be patient. It will take about 5-10 minutes and then you will be prompted that the installation is successful. One more reminder: if you report any error, first check whether it is a network problem, such as 443, connect timeout, etc.

Installation completed

At this point, the construction of git+homebrew+Node+npm has been completed. Next, you can execute the npm install and npm run ... commands locally to start the front-end Vue project and access it normally.

npm package installation failed: You can install the required dependencies by modifying the domestic image. After successfully executing the following code, you can execute npm install to download dependencies and start the project normally. It has been tested and is effective.

npm config set registry https://registry.npm.taobao.org
npm info underscore

This concludes this article about the steps to start the Vue project with the M1 pro chip. For more information about starting Vue with M1 pro, please search previous articles on 123WORDPRESS.COM or continue browsing the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Detailed steps to install nginx on Apple M1 chip and deploy vue project
  • How to install PyTorch on M1 mac
  • M1 Macbook vscode C++ debug debugging implementation
  • Install TensorFlow environment on macOS M1 (AppleSilicon)
  • Specific implementation of installing and configuring the Conda environment on macOS M1 (Apple Silicon)
  • Example of how to install python3.9 using miniforge on MacBook m1 chip
  • How to install Homebrew on Mac M1

<<:  Introduction and examples of hidden fields in HTML

>>:  Detailed explanation of pid and socket in MySQL

Recommend

Use pure CSS to create a pulsating loader effect source code

Effect Preview Press the "Click to Preview&q...

Modularity in Node.js, npm package manager explained

Table of contents The basic concept of modularity...

The use of textarea in html and common problems and case analysis

The textarea tag is an HTML tag that we often use....

Detailed explanation of MySQL file storage

What is a file system We know that storage engine...

What we have to say about CSS absolute and relative

Written in the opening: Absolute said: "Rela...

CSS Pick-up Arrows, Catalogs, Icons Implementation Code

1. CSS Miscellaneous Icons There are three ways t...

How to use vue-video-player to achieve live broadcast

Table of contents 1. Install vue-video-player 2. ...

Detailed explanation of MySQL three-value logic and NULL

Table of contents What is NULL Two kinds of NULL ...

How to view Linux ssh service information and running status

There are many articles about ssh server configur...

Summary of MySql import and export methods using mysqldump

Export database data: First open cmd and enter th...

How to use SessionStorage and LocalStorage in Javascript

Table of contents Preface Introduction to Session...

960 Grid System Basic Principles and Usage

Of course, there are many people who hold the oppo...

Encapsulate a simplest ErrorBoundary component to handle react exceptions

Preface Starting from React 16, the concept of Er...