preface

As an API engineer standing on the shoulders of giants, I am sure to use a lot of plug-ins in daily development. What if the plug-ins of your current project are many generations behind the new version?

I introduced the syntax and configuration of vuecil3, and my project upgrade was completed by directly replacing the entire SRC folder, but how do we upgrade the plugin package?

How does the NPM package in the VUE project continue to upgrade and maintain

Replace package.json

After the upgrade, copy the code related to the NPM package in the packag.json file of the earlier version to the new version.

CNPM install or NPM Install downloads the package and starts the project to see if it works.

This time the plugin is also the old version, so we need to upgrade the NPM package, as a good API engineer, I will not use NPM update to upgrade one by one ah, must find a suitable plug-in to let it to help me upgrade ~

Here are the necessary plug-ins for the upgrade and subsequent maintenance:

2. Plugin: NPM-check

2.1 Installing the Upgrade Plug-in – NPm-check

 npm install -g npm-check
Copy the code

Npm-check Checks whether the installation is complete

2.2 NPM – check upgrade

  • Overview of operation commands
-u, --update interactive updates -y, --update-all All updates -g, --global Check global modules -s, --skip-unused Skip check unused packets -p, -d, --dev-only only devDependencies;Copy the code
  • Common commands
>> npm-check -u
Copy the code

This will detect all NPM packages, and finally use the space to select the package to upgrade, press Enter to confirm, so you will get a new version of the framework of the package are the latest project,Then see if there are any syntax changes in the new version of the package, to improve.

3. Replace the mirror library in the Intranet environment

Since our project is developed in the Intranet environment, we will record how to change the NPM mirror address in the Intranet environment.

3.1 Temporarily Changing the NPM Mirror Address

npm install <registry-name> --registry https://registry.npmjs.org
Copy the code

3.2 Permanently Changing the NPM Mirror Address

npm config set registry https://registry.npmjs.org  
npm config list
Copy the code

summary

This article is mainly about NPM package how to continue to upgrade maintenance and Intranet environment to replace the mirror library, then continue to record the vUE project plug-in upgrade and package optimization…

Over ~ Leave a message with a problem

If this article is helpful to you, please don’t forget to give me a three-button like call oh