lantern-connect 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lantern-connect",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "CLI installer to connect AI tools (Claude, Gemini, Cursor) to Lantern",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,8 +1,37 @@
1
1
  import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs'
2
2
  import { dirname } from 'path'
3
+ import { execSync } from 'child_process'
3
4
  import { tools } from '../detect.js'
4
5
 
6
+ function checkNodeVersion() {
7
+ try {
8
+ const version = execSync('node -v', { encoding: 'utf-8' }).trim()
9
+ const major = parseInt(version.slice(1).split('.')[0], 10)
10
+
11
+ if (major < 20) {
12
+ const lines = [
13
+ `Node.js >= 20 required, but found ${version}`,
14
+ '',
15
+ 'Claude Desktop uses mcp-remote which requires Node.js 20+.',
16
+ '',
17
+ 'To fix:',
18
+ ' • If using nvm: nvm install 20 && nvm alias default 20',
19
+ ' • Or download from: https://nodejs.org',
20
+ '',
21
+ 'Then restart your terminal and run lantern-connect again.',
22
+ ]
23
+ throw new Error(lines.join('\n'))
24
+ }
25
+ } catch (err) {
26
+ if (err.message.includes('Node.js >= 20')) {
27
+ throw err
28
+ }
29
+ // If node command fails, let it proceed and fail later with a clearer error
30
+ }
31
+ }
32
+
5
33
  export function configureClaudeDesktop(mcpUrl) {
34
+ checkNodeVersion()
6
35
  const configPath = tools.claudeDesktop.configPath()
7
36
 
8
37
  // Ensure directory exists