UniApp adds NPM package management tool

1. Open the UniAPP project and enter the terminal. If HBuilderX is not available, go to Menu-View-Display Terminal, and then select the terminal at the bottom of the editor. Or enter the project root directory through the system terminal

Second, run

npm init -y

-y is the default setting yes, package.json will be generated after initialization

Three, install the required packages

npm install jquery

The relevant packages will be installed under node_modules. install can be abbreviated as i. After the command, you can add @ version, such as @3.0.0, or the latest stable version of @latest, for example: npm install [email protected]

Four, update

npm update jquery

If the package needs to be updated, you can use this

Five, delete the package

npm uninstall jquery

You can use NPM happily, just like it.

 

Guess you like

Origin blog.csdn.net/bitcser/article/details/104836619