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
1. Grid layout (grid): It divides the web page in...
Preface tcpdump is a well-known command-line pack...
Table of contents Preliminary Notes Problem Repro...
First, open the virtual machine Open xshell5 to c...
Preface: Mybatis special character processing, pr...
After the National Day holiday, did any of you fi...
Recently, Microsoft released the 2019 server syst...
If you want to exit bash, there are two options: ...
Ⅰ. Problem description: Use html+css to implement...
MongoDB is cross-platform and can be installed on...
1. The difference between TEXT and BLOB The only ...
This article uses an example to describe how to r...
On the server, in order to quickly log in to the ...
1: What is openssl? What is its function? What is...
FireFox is a commonly used browser with many exte...