How to use npm to download vue.js
How to use npm to download vue.js: First go to the [node.js] official website to download and install the tool; then install bower; then initialize npm; finally pass "npm install vue -- save" to download vue.
Recommended: "vue tutorial"
The operating environment of this tutorial: windows7 system, Vue2.9.6 version, this method is applicable to all brands of computers.
Use npm to download vue:
1. Install npm
1. Install node.js
npm(Node Package Manager): Package manager under node.js
Go to the node.js official website to download and install the tool. After nodejs is installed, npm will be automatically installed. Enter the following command on the command line to test whether it is installed. If successful, the version number will appear correctly.
1 2 |
|
Look at the other two directories: npm and npm-cache under C:\Users\Administrator\AppData\Roaming. The local warehouse of npm runs in the user directory of the system disk c drive (not seen) to npm-cache because it has not been used and the cache directory is generated as soon as it is used), we tried to move these two directories back to D:\nodejs
2. Change the local library and cache directory
First create 2 new folders in the nodejs directory: node_cache and node_global
Then run the following 2 commands
1 2 |
|
Look at npm’s local warehouse, enter the following commands and find that the directory has changed :
1 |
|
3. Configure the download source address
Enter the following command to configure the Taobao mirror station:
1 |
|
Enter the following command to display all configuration information:
1 |
|
We pay attention to a configuration file C:\Users\Administrator\.npmrc and find that the information just configured is in this file.
4. Update npm
Update npm:
1 |
|
Check what modules are in global again:
1 |
|
5. Add environment variables
Add D:\nodejs\node_global to the environment variable PATH.
2. Download the core library vue.js
1. Install bower
Install bower first: (To install bower, you need to install node.js and git first)
1 |
|
After installation, corresponding commands will be added in the node_global directory.
Check the vue version:
1 |
|
2. Initialize npm
Initialize npm and guide the creation of a package.json file in the project to save the installation package information:
1 |
|
3. Download vue to local
Enter the project root directory, cnpm install vue --save or -S (cnpm is Taobao npm, if npm changes the download source The address is Taobao source, you can use npm directly instead of cnpm)
1 |
|
The above is the detailed content of How to use npm to download vue.js. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



When using the Vue framework to develop front-end projects, we will deploy multiple environments when deploying. Often the interface domain names called by development, testing and online environments are different. How can we make the distinction? That is using environment variables and patterns.

Ace is an embeddable code editor written in JavaScript. It matches the functionality and performance of native editors like Sublime, Vim, and TextMate. It can be easily embedded into any web page and JavaScript application. Ace is maintained as the main editor for the Cloud9 IDE and is the successor to the Mozilla Skywriter (Bespin) project.

The difference between componentization and modularization: Modularization is divided from the perspective of code logic; it facilitates code layered development and ensures that the functions of each functional module are consistent. Componentization is planning from the perspective of UI interface; componentization of the front end facilitates the reuse of UI components.

Solution to npm react installation error: 1. Open the "package.json" file in the project and find the dependencies object; 2. Move "react.json" to "devDependencies"; 3. Run "npm audit in the terminal --production" to fix the warning.

Foreword: In the development of vue3, reactive provides a method to implement responsive data. This is a frequently used API in daily development. In this article, the author will explore its internal operating mechanism.

Vue.js has become a very popular framework in front-end development today. As Vue.js continues to evolve, unit testing is becoming more and more important. Today we’ll explore how to write unit tests in Vue.js 3 and provide some best practices and common problems and solutions.

In Vue.js, developers can use two different syntaxes to create user interfaces: JSX syntax and template syntax. Both syntaxes have their own advantages and disadvantages. Let’s discuss their differences, advantages and disadvantages.

In the actual development project process, sometimes it is necessary to upload relatively large files, and then the upload will be relatively slow, so the background may require the front-end to upload file slices. It is very simple. For example, 1 A gigabyte file stream is cut into several small file streams, and then the interface is requested to deliver the small file streams respectively.
