Home > Web Front-end > JS Tutorial > body text

How to use npm to download specified version components

php中世界最好的语言
Release: 2018-05-29 10:09:56
Original
2331 people have browsed it

This time I will show you how to use npm to download specified version components. What are the precautions for using npm to download specified version components. The following is a practical case, let's take a look.

First make sure that the file directory contains the

package.json
Copy after login
Copy after login

file.

If not, you can create it through

npm init
Copy after login

.

Then just Just add the

@2.8.1
Copy after login

version number after the component,

For example: react-router has been updated to version 4.x, I would like To download the 2.x version, you can complete the download through the following command

npm install --save-dev react-router@2.8.1
Copy after login

. You can check the react-router version under the

package.json
Copy after login
Copy after login

file.

I believe you have read the case in this article. You have mastered the method. For more exciting information, please pay attention to other related articles on the php Chinese website!

Recommended reading:

How to implement a custom multi-select event in WeChat applet

When select is not used How to implement the drop-down box function under vue

The above is the detailed content of How to use npm to download specified version components. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template