npm installation tutorial: 1. Download the Node.js installation packageOfficial website: https://nodejs.org/en/ 2. Before using, let's first understand what these three things are used for.webpack: Its main purpose is to prepare all static resources that need to be released on the browser side through CommonJS syntax, such as merging and packaging resources. vue-cli: User-generated Vue project template. (Help you quickly start a Vue project, that is, give you a set of Vue structures, including basic dependency libraries, which can be installed with just npm install) As shown in the figure, the version downloaded now is 14.16.0 LTS (recommended for users now): Double-click to install1. First, we can see that the default path is C drive. Here we take D drive as an example for installation: d:\node.js Click Next all the way Click Finish Next we win + r shortcut key We enter echo %PATH% We enter node -v and npm -v Let's take a look at C:\Users\Administrator\AppData\Roaming We can see that npm's local repository is running in the user directory of the system disk C drive (npm-cache is not seen because it has not been used. The cache directory is generated as soon as it is used). We try to move these two directories back to D:\nodejs First create two directories as shown below Then run the following 2 commands npm config set prefix "D:\nodejs\node_global" As shown below, let's take a look at the local repository of npm and enter the command npm list -global Enter the command npm config set registry=http://registry.npm.taobao.org to configure the mirror site Enter the command npm config list to display all configuration information. Let’s focus on one configuration file. C:\Users\Administrator.npmrc Using txt text or a text editor, we can see the configuration information just now: Check if the mirror station works. Command 1 npm config get registry Check if the mirror station is OK Command 2 Note that at this time, the default module D:\nodejs\node_modules directory will be changed to D:\nodejs\node_global\node_modules directory. (Note that the following operations require you to reopen CMD for the above environment variables to take effect) 1. Test NPM installation of vue.js Command: npm install vue -g Let's take a look: D:\nodejs\node_global\node_modules\vue 2. Test NPM installation of vue-routerCommand: npm install vue-router -g Run npm install vue-cli -g to install the Vue scaffolding Add D:\nodejs\node_global to the path environment variable Reopen CMD and test whether Vue is working properly Note that the vue-cli tool has built-in templates including webpack and webpack-simple. The former is for more complex and professional projects. Initialization, installation dependencies: Run npm install to install dependencies Run npm run dev Open http://localhost:8080 in your browser as prompted. Automatically open the browser http://localhost:8080/#/ Enter in the DOS command: npm run build Generate static files and open the newly generated index.html file in the dist folder Next, we will use the Hbuilderx tool to configure Node.js and npm Official website: https://www.dcloud.io/hbuilderx.htmlHubilderX link Enter npm run dev in the terminal to run the project This is the end of this article about node.js installation and HbuilderX configuration. For more relevant node.js HbuilderX configuration content, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Install two MySQL5.6.35 databases under win10
>>: VSCode configuration Git method steps
MySQL dynamically modify replication filters Let ...
Table of contents 1. List interface display examp...
1. Download from the official website and unzip h...
The following are all performed on my virtual mac...
A few days ago, a colleague asked me a question a...
Use Javascript to achieve the countdown effect, f...
What is a table? It is composed of cell cells. In...
For those who don't know how to install the s...
Table of contents Lifecycle Functions Common life...
Log in to MySQL first shell> mysql --user=root...
Using the CSS3 border-image property, you can set...
Table of contents Preface Instruction Basics Hook...
This article records the detailed tutorial of MyS...
Preface Interceptor In some modern front-end fram...
[Looking at all the migration files on the Intern...