Home  >  Article  >  Web Front-end  >  How to use npm to download specified version components

How to use npm to download specified version components

php中世界最好的语言
php中世界最好的语言Original
2018-05-29 10:09:562343browse

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

file.

If not, you can create it through

npm init

.

Then just Just add the

@2.8.1

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

. You can check the react-router version under the

package.json

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!

Statement:
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