npx create-next-app@x.y.z installs @lastest instead of the requested version
Answered
New Zealand posted this in #help-forum
New ZealandOP
I'm trying to create a next app with a specific version (13.1.6) in my case but after running
Any suggestions, or am I missing something? Thanks, in advance!
npx create-next-app@13.1.6 and going through the prompts menu, the installed version is the latest (13.4.19) at this post date. I'm using node LTS 18.17.1Any suggestions, or am I missing something? Thanks, in advance!
Answered by Dayo
you're right, that didn't work for me too. this worked though:
npx create-next-app && cd myapp3 && npm i -S next@13.1.6
npx create-next-app && cd myapp3 && npm i -S next@13.1.6
5 Replies
@New Zealand I'm trying to create a next app with a specific version (13.1.6) in my case but after running `npx create-next-app@13.1.6` and going through the prompts menu, the installed version is the latest (13.4.19) at this post date. I'm using `node LTS 18.17.1`
Any suggestions, or am I missing something? Thanks, in advance!
not sure why that happened. but since you've already installed, you can try manually changing the version in your package.json and running npm install again. also, delete the .next folder before you run dev
New ZealandOP
Thanks @Dayo! do you have any idea how to accomplish this when starting a project from scratch?
you're right, that didn't work for me too. this worked though:
npx create-next-app && cd myapp3 && npm i -S next@13.1.6
npx create-next-app && cd myapp3 && npm i -S next@13.1.6
Answer
New ZealandOP
Thanks!!!
the reason this happened is because the command only runs
create-next-app version x.y.z; if create-next-app internally specifies to install next latest (which it does) then next@latest is still installed