Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/guide/env.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,10 @@ Selectors omit unselected top-level fields or PM families. Registry listing is a

## Custom Node.js Mirror

By default, Vite+ downloads Node.js from `https://nodejs.org/dist`. If you're behind a corporate proxy or need to use an internal mirror (e.g., Artifactory), set the `VP_NODE_DIST_MIRROR` environment variable:
Set `VP_NODE_DIST_MIRROR` to use a mirror for Node.js version lookups and downloads. The default URL depends on your platform.

- macOS, Windows, and glibc Linux use `https://nodejs.org/dist`.
- musl Linux uses `https://unofficial-builds.nodejs.org/download/release`.

```bash
# Install a specific version from your custom mirror
Expand All @@ -323,6 +326,8 @@ VP_NODE_DIST_MIRROR=https://my-mirror.example.com/nodejs/dist vp env default lts
echo 'export VP_NODE_DIST_MIRROR=https://my-mirror.example.com/nodejs/dist' >> ~/.zshrc
```

For firewall rules, see [Network Hosts](/guide/global-cli#network-hosts).

## Node.js Signature Verification

When installing Node.js from the official `nodejs.org` distribution, Vite+ downloads the PGP-signed `SHASUMS256.txt.asc` and verifies it against the bundled Node.js release keys before trusting any checksum. This protects against a tampered `SHASUMS256.txt` paired with a matching malicious archive. The SHA-256 checksum of the downloaded archive is always verified afterward.
Expand Down
43 changes: 42 additions & 1 deletion docs/guide/global-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ On Windows, you can instead download and run [`vp-setup.exe`](https://setup.vite

For macOS and Linux, see the [Homebrew tap guide](/guide/homebrew) for installation instructions.

If your firewall restricts outbound connections, see [Network Hosts](#network-hosts).

The installer uses the Node.js version pinned in the Vite+ repository's [`.node-version`](https://github.com/voidzero-dev/vite-plus/blob/main/.node-version) to install its JavaScript dependencies. Each Vite+ release embeds this version at build time. Development and CI use the same file, which the dependency-upgrade workflow keeps up to date. CI integrations can select another compatible version through [`VP_SETUP_NODE_VERSION`](#vp-setup-node-version).

After installation, open a new shell and run:
Expand Down Expand Up @@ -215,6 +217,15 @@ Low-priority managed shims live in `<DATA>/fallback-bin`, where `<DATA>` is the
curl -fsSL https://vite.plus | NPM_CONFIG_REGISTRY=https://registry.npmmirror.com bash
```

#### `VP_LEGACY_INSTALLER_URL`

- **Purpose**: URL of the fallback script for older binaries that cannot run their own setup. The installer uses this URL only if the matching legacy script is missing from the installer's directory.
- **Default**: `https://viteplus.dev/install-legacy.sh` on macOS and Linux, or `https://viteplus.dev/install-legacy.ps1` on Windows.
- **Example**:
```bash
VP_LEGACY_INSTALLER_URL=file:///opt/vite-plus/install-legacy.sh bash ./install.sh
```

#### `VP_NODE_MANAGER`

- **Purpose**: Control Node.js version manager setup during installation.
Expand Down Expand Up @@ -265,7 +276,7 @@ These variables configure the installed Vite+ CLI. `VP_HOME` (above) also applie
#### `VP_NODE_DIST_MIRROR`

- **Purpose**: Node.js distribution mirror URL
- **Default**: `https://nodejs.org/dist`
- **Default**: `https://nodejs.org/dist` on macOS, Windows, and glibc Linux, or `https://unofficial-builds.nodejs.org/download/release` on musl Linux.
- **Details**: [Custom Node.js Mirror](/guide/env#custom-node-js-mirror)

#### `VP_NODE_VERSION`
Expand Down Expand Up @@ -482,6 +493,36 @@ Use Homebrew to [upgrade](/guide/upgrade#homebrew) or [remove](/guide/implode#ho

See the [official tap guide](/guide/homebrew) for registry configuration and migration instructions.

## Network Hosts

On Linux, you can copy `install.sh` from a connected machine and run `bash ./install.sh`. For a stable release using npm or pnpm with public registry packages, allow outbound HTTPS to the npm registry and the Node.js host for your platform.

### Setup and everyday use

| Default host | When you need it | Override |
| --------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------- |
| `registry.npmjs.org` | Setup and `vp upgrade` fetch the CLI, pnpm, and dependencies. `vp env` downloads package managers. `vp install`, `vp dlx`, and `vp create` can fetch npm packages. | [`NPM_CONFIG_REGISTRY`](#npm-config-registry). Managed package-manager downloads also read `.npmrc`. |
| `nodejs.org` on macOS, Windows, and glibc Linux. `unofficial-builds.nodejs.org` on musl Linux (such as Alpine). | Setup and `vp env` resolve versions such as `lts` and download Node.js. | [`VP_NODE_DIST_MIRROR`](#vp-node-dist-mirror) |

`vp env list-remote` lists Node.js and package-manager versions. Use `vp env list-remote node` to query only the Node.js index. [Node.js signature verification](/guide/env#node-js-signature-verification) uses bundled keys and needs no keyserver.

Interactive `vp` commands can check npm for updates even with all tools installed. Vite+ caches the result for 24 hours. Set `VP_NO_UPDATE_CHECK=1` to disable [automatic update checks](/guide/upgrade#automatic-update-checks).

### Hosts for specific features

| Feature | Additional hosts | When you need them |
| -------------------------------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| One-line installer | `vite.plus`, `viteplus.dev` | `vite.plus` redirects to `install.sh` or `install.ps1` on `viteplus.dev`. A local copy skips this download. Older binaries may also need the [legacy installer](#vp-legacy-installer-url). |
| Windows standalone installer | `setup.viteplus.dev`, `github.com`, `release-assets.githubusercontent.com` | The setup page links to GitHub Releases, which redirects to the asset host. You can copy the executable from a connected machine. |
| Stable [Homebrew tap](/guide/homebrew) | `github.com`, `release-assets.githubusercontent.com` | Homebrew fetches the tap and release archive on install or upgrade. First use also needs the npm and Node.js hosts above. |
| [Preview builds](#vp-pr-version) | `registry-bridge.viteplus.dev` | The bridge serves preview packages. Other dependencies can still come from `registry.npmjs.org`. |
| GitHub templates for `vp create` | `github.com`, `codeload.github.com` | For templates such as `vite:library`, `degit` resolves the revision on GitHub and downloads the archive from codeload. |
| Yarn projects | `registry.yarnpkg.com` | Yarn fetches project dependencies here by default. In modern Yarn, set [`npmRegistryServer`](https://yarnpkg.com/configuration/yarnrc#npmRegistryServer) in `.yarnrc.yml` to change it. |

Project dependencies, generators, and tasks can contact other hosts. Generators can call `api.github.com`. Vite+ disables these lookups for [workspace Bingo generators](/guide/create#run-a-generator) with `--skip-requests`. See [which commands can use the network](/guide/ci#which-commands-can-use-the-network).

For machines without public internet access, see [Install from private mirrors](#install-from-private-mirrors).

## Use It Without a Local Package

The global installation is enough for runtime, package-manager, and task-runner workflows:
Expand Down
Loading