Old front-end projects need to be upgraded and updated with technology stack versions (React, Vue, etc.)

1. To check which packages of the current project can be updated, execute the following command

npm-check

Note: If an error is reported when executing this command, it may be that npm-check is not installed. You need to install it globally first. The command is

npm install -g npm-check

2. After executing the npm-check command, you can see the upgradeable technology stack and the corresponding instructions and versions.

 Similar to this, if I want to upgrade the next.js version from the original 12.1.5 to 12.3.1, I can execute this command:

npm install [email protected] --save

After executing this instruction, you will find that the version in package.json has changed accordingly:

The contents of both folders have been changed accordingly: 

 

 In this way, the version upgrade is completed! ! !

In addition: If there are errors reported in some places in the code after the upgrade, check it out. It may be that the current version does not support some syntax in the previous version, and just make corresponding adjustments according to the requirements of the current version!

Guess you like

Origin blog.csdn.net/m0_53703061/article/details/127076866