#How to use create-vite to initialize a v2 project

1 messages · Page 1 of 1 (latest)

hasty arrow
#

I want to initialize a vite with react project so that it uses vite v2, not v3. I am trying the following command where "2.9.5" is the most recent v2 version of the create-vite util(https://www.npmjs.com/package/create-vite/v/2.9.5) but it does not work as expected and the resulting app has vite 3.1.0 in dependencies. How to fix it? Also, how to do it with yarn?

npm init [email protected] vite2app -- --template react

verbal bear
#

could try npm create [email protected] instead. checking the changelog, looks like 2.9.5 was accidentally released with vite 3 i think

#

yarn: yarn create vite

hasty arrow
#

how about creating an app with --template option?

verbal bear
#

I ran the command you showed and the package.json has "vite": "^2.9.15"

hasty arrow
#

interesting...no matter how I try, it creates packages.json with "vite": "^3.1.0"