-
I've been using Svelte and SvelteKit for a few months now and am loving the experience. I see there is a change to the routing structure and realise I have not updated versions since I started and find I am a bit clueless as to how I actually do this. The Migration guide says "We recommend updating to the most recent version before these changes — @sveltejs/[email protected] — and ensuring that your app works". So what do I do? Edit package.json directly? run npm install with the new version. What exact syntax should be used? As trying the above with variants of "1.0.0-next.404", "next.404" all seem to give errors. Just doing npm update does not change the version in package-lock.json from the next.326 version that was installed originally. I realise this is more of an npm question than svelte and I have looked in the npm and svelte docs for answers, but hoping someone could shed some light. Hopefully there is a two line answer saying "edit this line of package.json and then run npm update or whatever" Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
You should run |
Beta Was this translation helpful? Give feedback.
-
I have managed to do the update. In case this helps future travellers. I was a bit thrown by the syntax of the svelte versions "1.0.0-next.405" and have no idea how this might work with the ^ notations. However one can use the npm command or edit the line in the packages.json file and run These didn't work for me initially so I created a new project, copied across the packages.json file, deleted my old node_modules and then ran npm install. This added the line for There was still an issue causing problems so I copied across the The prepare script installing sveltekit seemed to be objecting to these aliases and replacing these files cleared the way for full install. I then moved in all the other dependencies from my old packages.json file and ran install once more. It seemed 405 is post routes change as I got messages telling me I needed to update them. I was then able to run the Now I need to tidy up and get my code working again. |
Beta Was this translation helpful? Give feedback.
I have managed to do the update. In case this helps future travellers. I was a bit thrown by the syntax of the svelte versions "1.0.0-next.405" and have no idea how this might work with the ^ notations. However one can use the npm command
npm install <package>@<version>
npm i @sveltejs/[email protected]
or edit the line in the packages.json file and run
npm install
"@sveltejs/kit": "1.0.0-next.405",
These didn't work for me initially so I created a new project, copied across the packages.json file, deleted my old node_modules and then ran npm install.
This added the line for
"vite": "^3.0.4"
mentioned above by Geoff. I knew sveltekit used vite and that it had not previously been in the p…