Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install an older version of vite

I am trying to use Quasar Framework which doesn't support Vite 4.1 yet. So I need to install some version of Vite in the 3. range. But how do I do this? The install process I would like to use is:

Like

npm create vite@latest

So far I have tied npm create vite@3 and it doesn't seem to work. It still comes down with the latest packages and Quasar is still complaining.

I am trying to take advantage of the CLI walkthrough that vite offers where it can scaffold Vue, TS, and Pinia automatically, but use an older version of Vite.

Any help appreciated.

Thanks!

like image 434
WillD Avatar asked Oct 21 '25 07:10

WillD


1 Answers

If for some reason npm create vite@3 isn't make a vite v3 project (it should), you can always edit the package.json and manually change the vite version and reinstall your packages (delete node_modules, delete package-lock.json, run npm install). Before you do those steps change your list of dependencies and devDependencies to the following:

"dependencies": {
    "@quasar/extras": "^1.15.8",
    "quasar": "^2.10.2",
    "vue": "^3.2.41"
  },
  "devDependencies": {
    "@quasar/vite-plugin": "^1.2.3",
    "@vitejs/plugin-vue": "^3.2.0",
    "sass": "1.32.12",
    "vite": "^3.2.3"
  }

Then just follow the documentation for updating main.js, vite.config.js, and creating the src/quasar-variables.sass file.

like image 97
yoduh Avatar answered Oct 23 '25 21:10

yoduh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!