Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use yarn to build vue Project under Linux

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

Today, the editor will share with you the relevant knowledge points about how to use yarn to build a vue project under Linux. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article.

1. Installation of yarn

Note: the use of yarn is the same as that of npm, and the nodejs environment should be installed before. If it is not installed, please install nodejs.

The Chinese document address of yarn with a detailed address on it.

Https://yarnpkg.com/zh-Hans/docs

The basic use of the yarn command, which is basically the same as the use of npm, will be slightly different.

Https://yarnpkg.com/zh-Hans/docs/cli/

The installation of yarn will not be described here because it is described in detail in the documentation. Please refer to the official documentation for installation.

Https://yarnpkg.com/zh-Hans/docs/install

2. Build the vue project

/ / install vue scaffolding, which is a tool for building vue projects-g for global installation

Npm install-g vue-cli

/ / use the webpack packaging tool

Vue init webpack my-project

/ / some information will be prompted after that. Select yes for all and press enter all the time.

/ / after completion, go to the root directory of the project you created

Cd my-project

/ / install dependency package

Yarn

/ / Note: yarn is the abbreviation of yarn install. You can tap yarn directly. It has the same function as npm install.

/ / Last run the project

Yarn run dev

/ / the browser will automatically open and run a page, and the following page appears, indicating that it is successful.

In addition, the newly created project uses port 8080 by default. If the port is occupied or needs to be changed, go to the root directory in the project, there is a config file, and there is an index.js file below, in which you can change your port number.

These are all the contents of the article "how to use yarn to build a vue project under Linux". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report