Registry / web-framework / vls
library0.8.5jsnpmunverified

The `vls` (Vue Language Server) package provides a Language Server Protocol (LSP) implementation specifically for Vue.js projects. Its primary role was to power editor extensions like Vetur in VS Code, offering features such as intelligent code completion, diagnostics, syntax highlighting, and formatting for Vue Single File Components (SFCs). The `vls` npm package itself is currently at version `0.8.5` and has not received significant updates for several years, indicating a stagnant development pace for the standalone package. While Vetur, which historically consumed `vls`, continued to evolve for a time (reaching versions like `0.37.x`), the broader Vue ecosystem, particularly with the advent of Vue 3, has largely transitioned to Volar as the recommended language server due to its more comprehensive and official support for modern Vue 3 features like `<script setup>` and enhanced TypeScript integration. As a result, `vls` is primarily relevant for older Vue 2 projects or as a foundational component for historical language tooling, with limited utility for current Vue 3 development.

npm install vls
INSTALL
IMPORT
SIG · VLS
V
vls
web-frameworkjavascriptv0.8.5
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

vls (CLI command)
✓ npm install -g vls vls --version
✗ import { vls } from 'vls'
`vls` is primarily consumed as a global CLI command for direct user interaction or spawned by language client extensions, rather than being imported as a module into application code.
vueServerMain
✓ require.resolve('vls/dist/vueServerMain')
✗ import { vueServerMain } from 'vls/dist/vueServerMain'
This path points to the server's main executable script. It is typically used programmatically by language client implementations with `child_process.spawn('node', [require.resolve('vls/dist/vueServerMain')])` to launch the language server process.
VLS (type)
✓ import type { VLS } from 'vls'
✗ import { VLS } from 'vls'
For TypeScript users developing custom language client extensions or programmatically interacting with VLS, its type definitions can be imported. This is a type-only import and does not provide runtime values.

Demonstrates how to install VLS globally via CLI and conceptually how a language client would spawn the `vls` server process for LSP communication.

npm install -g vls # Verify installation and server functionality vls --version # Example of how a language client might launch it (conceptual) const { spawn } = require('child_process'); const path = require('path'); const vlsPath = require.resolve('vls/dist/vueServerMain'); console.log(`Attempting to start VLS from: ${vlsPath}`); const serverProcess = spawn('node', [vlsPath], { stdio: ['pipe', 'pipe', 'pipe'] // stdin, stdout, stderr for LSP communication }); serverProcess.stdout.on('data', (data) => { console.log(`VLS STDOUT: ${data.toString().trim()}`); }); serverProcess.stderr.on('data', (data) => { console.error(`VLS STDERR: ${data.toString().trim()}`); }); serverProcess.on('exit', (code) => { console.log(`VLS process exited with code ${code}`); }); // In a real client, you'd send LSP messages to serverProcess.stdin // and parse responses from serverProcess.stdout.
Debug
Known issues
breakingThe `vls` package, and by extension the Vetur VS Code extension it powered, provides only basic and incomplete support for modern Vue 3 features, particularly `<script setup>`, Composition API refinements, and advanced TypeScript integration. Many Vue 3-specific language features will not function correctly or at all.
fix
For full language tooling support in Vue 3 projects, it is strongly recommended to migrate to Volar (e.g., the 'Vue Language Features (Volar)' extension for VS Code).
affects: all
deprecatedThe `vls` npm package at version `0.8.5` has not been updated for an extended period and is considered deprecated for modern Vue.js development. While the Vetur extension historically used `vls` as its core, Vetur itself now explicitly recommends Volar for Vue 3 projects, indicating a shift in the ecosystem.
fix
For all new Vue projects, especially those using Vue 3, it is advised to use Volar. For legacy Vue 2 projects, be aware that VLS/Vetur might not receive further updates or bug fixes.
affects: >=0.8.5
gotchaThe `vls` package explicitly requires Node.js version `10` or higher to run, as specified in its `engines` field. Attempting to run `vls` with older Node.js versions will prevent the language server from starting or cause unexpected errors.
fix
Ensure your Node.js environment is version 10 or greater. Update Node.js if necessary using a version manager like `nvm` or `volta`.
affects: all
Errors
Common errors & fixes
vls: command not found
The `vls` executable is not installed globally or is not in the system's PATH.
fix
Install `vls` globally using `npm install -g vls` or `yarn global add vls`.
Error: Cannot find module 'vls/dist/vueServerMain'
A language client attempted to resolve the `vueServerMain` entry point but `vls` is not installed as a local dependency or the path is incorrect.
fix
Ensure `vls` is installed as a local dependency (`npm install vls --save` or `yarn add vls`) in the project where the language client is running.
Upgrade
Version history
0.8.5latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
vls — npm install vls · libregistry