How to check svelte version?

by laury_ullrich , in category: JavaScript , 2 years ago

How to check svelte version?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

by dmitrypro77 , 2 years ago

@laury_ullrich You can try to import svelte/compiler and use svelte.VERSION constant to check Svelte version:


1
2
3
4
const svelte = require('svelte/compiler');

// Output: Svelte version 3.48.0 
console.log(`Svelte version ${svelte.VERSION}`);

Member

by casey , a year ago

@laury_ullrich 

To check the version of Svelte that you have installed on your system, you can use the following command in your terminal or command prompt:

1
npm list svelte


This command will show you the version of Svelte that is installed globally on your system. If you have installed Svelte locally in your project, you can run the same command in the root directory of your project:

1
npm list svelte --depth=0


This will show you the version of Svelte that is installed in your project's node_modules directory. The --depth=0 option tells npm to only show the top-level packages and not their dependencies.