1. Node.js and Vue1.1 Node.js
1.2 Vue.js
1.3 Overview of this article In this article, the blogger will show you how to run the Vue.js project locally, and at the same time be able to deploy the Vue project independently on the server; 2. Run the front-end Vue project in the local dev environment2.1 Download and install Node.js Download address: https://nodejs.org/zh-cn/ Select the Windows version. It is recommended to select the long-term support version. Just click OK as prompted. After node.js is installed, the environment variables will be automatically configured. After the installation is complete, open the cmd window and enter the command: node --version. If the following content appears, it means the installation is successful, as shown in the figure: 2.2 Install front-end development tools WebStrom and VsCode are often used on the front end. Here is an introduction to installing WebStrom: 1. Download WebStorm: Download address https://www.jetbrains.com/zh-cn/webstorm/download/ 2. Install WebStrom. There are many tutorials on the Internet. You can search Baidu for details. If you don’t use it for a long time, we can try it for free for 30 days. 3. Import the project: Click file -> open -> select the specific front-end project, click ok -> wait for the index to be built 4. Common commands: Build the project: npm install Start the service npm run dev Click the provided URL path and enter the browser to view the service, as shown in the figure: 2.3 Start using the command in package.json: We can directly click the green arrow to start, as shown in the figure:
There are other commands as well, which I will not go into detail about. Students can search on Baidu if they need to know. 3. Deploy the front-end Vue project in the server environment3.1 Deploy Node.js environment
3.2 Install the express-generator generator Enter the following command to install the generator: npm install express-generator -g Create an express project: express expressDemo (replace expressDemo with your own project name) The expressDemo project directory is as follows: Enter the project: cd expressDemo
Project Build: npm install Open our Windows development tool, use the npm build command to package the project, and copy the files under public to the public directory in expressDemo: Enter the following command to run expressDemo: npm start Open the browser and enter: http://localhost:3000 to see the effect
The above is how to start a Vue project. There are many other ways and students can find answers online. The simplest way is to directly copy all the codes and execute npm install+npm run dev to start successfully; if it is not a Vue project but a Node.js project, you can also use this method! The above is the details of how to start a Vue.js project. For more information about starting a Vue.js project, please pay attention to other related articles on 123WORDPRESS.COM! You may also be interested in:
|
<<: A simple method to modify the size of Nginx uploaded files
>>: MySQL database table and database partitioning strategy
Business scenario requirements and implementation...
Project Documentation Directory Div+CSS Naming Sta...
Preface In daily work, we sometimes run slow quer...
The preparation for the final exams in the past h...
nginx Overview nginx is a free, open source, high...
background Today, while cooperating with other pr...
Why is the title of the article “Imitation Magnif...
This article example shares the specific code of ...
Docker provides a way to automatically deploy sof...
Experimental environment: Physical machine Window...
Why beautify the file control? Just imagine that a...
Table of contents 1. Create a socket 2. Bind sock...
Integrity constraints Integrity constraints are f...
0. What is a tag? XML/HTML CodeCopy content to cl...
This article example shares the specific code of ...