@visa/cli 2.0.0-rc.10 → 2.0.0-rc.11
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/dist/cli.js +82 -84
- package/dist/mcp-server/index.js +43 -49
- package/install.ps1 +36 -5
- package/package.json +1 -1
package/install.ps1
CHANGED
|
@@ -123,15 +123,44 @@ try {
|
|
|
123
123
|
exit 1
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
# Check npm separately. Some Windows installs expose node before a refreshed
|
|
127
|
+
# shell can find npm, and npm failures are much easier to fix when called out.
|
|
128
|
+
try {
|
|
129
|
+
$npmVersionOutput = (& npm --version 2>$null | Select-Object -First 1)
|
|
130
|
+
if ($LASTEXITCODE -ne 0 -or -not $npmVersionOutput) { throw "not found" }
|
|
131
|
+
Write-Host " [OK] npm $($npmVersionOutput.Trim())" -ForegroundColor Green
|
|
132
|
+
} catch {
|
|
133
|
+
Write-Host " npm is required but was not found." -ForegroundColor Red
|
|
134
|
+
Write-Host " Install Node.js from https://nodejs.org/, close and reopen PowerShell, then try again." -ForegroundColor Yellow
|
|
135
|
+
Wait-BeforeExit
|
|
136
|
+
exit 1
|
|
137
|
+
}
|
|
138
|
+
|
|
126
139
|
# Install via npm
|
|
127
140
|
Write-Host " Running: npm install -g @visa/cli" -ForegroundColor Gray
|
|
128
|
-
& npm install -g @visa/cli 2>&1
|
|
141
|
+
$npmOutput = & npm install -g @visa/cli 2>&1
|
|
142
|
+
$npmExitCode = $LASTEXITCODE
|
|
143
|
+
$npmText = ($npmOutput | Out-String)
|
|
144
|
+
$npmOutput | Out-Host
|
|
129
145
|
|
|
130
|
-
if ($
|
|
146
|
+
if ($npmExitCode -ne 0) {
|
|
131
147
|
Write-Host ""
|
|
132
|
-
Write-Host " npm install failed (exit code $
|
|
133
|
-
|
|
134
|
-
|
|
148
|
+
Write-Host " npm install failed (exit code $npmExitCode)." -ForegroundColor Red
|
|
149
|
+
|
|
150
|
+
if ($npmText -match 'Access is denied|EACCES|EPERM|permission denied') {
|
|
151
|
+
Write-Host " Permission problem detected. Prefer a user-scoped npm prefix before using Administrator PowerShell:" -ForegroundColor Yellow
|
|
152
|
+
Write-Host ' mkdir "$env:USERPROFILE\.npm-global"' -ForegroundColor Yellow
|
|
153
|
+
Write-Host ' npm config set prefix "$env:USERPROFILE\.npm-global"' -ForegroundColor Yellow
|
|
154
|
+
Write-Host ' [Environment]::SetEnvironmentVariable("Path", "$env:USERPROFILE\.npm-global;$env:Path", "User")' -ForegroundColor Yellow
|
|
155
|
+
Write-Host " Then close and reopen PowerShell and rerun this installer." -ForegroundColor Yellow
|
|
156
|
+
} elseif ($npmText -match 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY|SELF_SIGNED_CERT_IN_CHAIN|CERT_HAS_EXPIRED|unable to verify') {
|
|
157
|
+
Write-Host " Certificate/proxy problem detected. If you are on a corporate network, use a personal network or ask IT for the npm certificate configuration." -ForegroundColor Yellow
|
|
158
|
+
Write-Host " Do not disable TLS verification globally." -ForegroundColor Yellow
|
|
159
|
+
} else {
|
|
160
|
+
Write-Host " Run manually for the full error, then retry:" -ForegroundColor Yellow
|
|
161
|
+
Write-Host " npm install -g @visa/cli" -ForegroundColor Yellow
|
|
162
|
+
}
|
|
163
|
+
|
|
135
164
|
Wait-BeforeExit
|
|
136
165
|
exit 1
|
|
137
166
|
}
|
|
@@ -158,10 +187,12 @@ Write-Host ""
|
|
|
158
187
|
if ($verifiedCommand) {
|
|
159
188
|
Write-Host " Visa CLI $visaVersion installed." -ForegroundColor Green
|
|
160
189
|
Write-Host " Run '$verifiedCommand setup' to get started." -ForegroundColor Cyan
|
|
190
|
+
Write-Host " After setup, run /mcp inside Claude Code, not PowerShell, if Claude Code was already open." -ForegroundColor Cyan
|
|
161
191
|
Write-Host ""
|
|
162
192
|
} else {
|
|
163
193
|
$primaryCommand = $cliCommandNames | Select-Object -First 1
|
|
164
194
|
Write-Host " Installed but '$primaryCommand' was not runnable from PATH yet." -ForegroundColor Yellow
|
|
165
195
|
Write-Host " Close and reopen PowerShell, then run: $primaryCommand setup" -ForegroundColor Yellow
|
|
196
|
+
Write-Host " Run /mcp inside Claude Code after setup if you need to reconnect the MCP server." -ForegroundColor Yellow
|
|
166
197
|
Write-Host ""
|
|
167
198
|
}
|