To downgrade an npm package, run the npm install <package>@<version> command. You need to provide the version you want to install with the @<version> syntax.
For example, Vue version 3 introduces a notable amount of breaking changes from Vue 2.
When you need to downgrade Vue from version 3 to version 2, use the command below:
npm install vue@2
npm will overwrite the vue package already installed in your node_modules/ folder.