Vue front-end tutorial

One, nodejs installation

sudo n stable (install the latest stable version v12.18.2)


Two, npm initialization project

npm init (need to enter prompt information)

npm init -y (default configuration)


Three, npm install module

1. Local installation

npm install modelname@version (install to the directory where the command is executed)

2. Global installation

npm root -g (View the global directory)

/usr/local/lib/node_modules

npm install modelname@version -g (install to the jquery global directory)

npm list -g (View global installed modules)

npm list module name (view specified module)

npm view jquery versions (view installable versions)

npm config set prefix " /usr/local/lib/node_modules " (modify the global path, the directory does not need to be created manually, execute npm root -g to create it automatically)

3. View the mirror source

npm get registry

https://registry.npmjs.org/

4. Configure the mirror source

npm config set registry https://registry.npm.taobao.org

Fourth, install specific modules (the production environment needs to add --save or -S to save the version number to package.json, and the development environment does not need to add --save or -S), (development environment --save-dev|-D)

1. npm install express --save -S (install web framework module)

2. npm install jquery --save -S

3. npm install [email protected]


Five, batch download modules

Enter the project and find the directory with the package.json file and execute npm install to automatically download the modules in package.json


Six, uninstall the module

npm uninstall jquery (partial uninstall, under the project directory)

npm uninstall jquery -g (global uninstall)


Guess you like

Origin blog.51cto.com/14895198/2554291