Same problem. How can I make this work? I just want to set up a Vite React project quickly without having to answer a bunch of questions about frameworks and stuff. Any ideas?
I encountered a similar issue recently. The problem lies in how npm interprets the command-line arguments. For Vite, it’s better to use ‘npx’ instead of ‘npm create’. Try this command:
This should work without any warnings. The ‘npx’ command ensures you’re using the latest version of create-vite and handles the arguments correctly. If you still face issues, make sure your Node.js and npm versions are up to date. As a last resort, you could also consider using the Vite CLI directly:
I’ve run into this exact problem before, and it can be frustrating. The issue is actually with how npm handles the command-line arguments for Vite. A workaround that’s worked consistently for me is using the ‘yarn’ package manager instead of npm. Here’s what you can do:
First, install yarn globally if you haven’t already:
npm install -g yarn
Then, create your Vite React project with this command:
yarn create vite my-cool-app --template react
This method bypasses the npm warning and creates the project smoothly. If you prefer sticking with npm, you could also try:
hey there! i had the same issue. try using ‘npm init vite@latest my-cool-app’ first, then choose react when prompted. if that doesn’t work, you could also use ‘yarn create vite my-cool-app --template react’ (install yarn if u don’t have it). hope this helps!