Skip to content

Add Git Bash (Windows) support to the CLI #1039

@wtto00

Description

@wtto00

Describe the bug

I'm using Git Bash on Windows, and I've set export VITE_PLUS_HOME="/d/home/.vite-plus" in my ~/.bash_profile.

After successfully installing via curl -fsSL https://vite.plus | bash, running the vp command resulted in a command not found error.

I fixed this by changing __vp_bin="D:/home/.vite-plus\bin" to __vp_bin="/d/home/.vite-plus/bin" in /d/home/.vite-plus/env. After refreshing the environment with source ~/.bash_profile, the vp command was recognized.

However, running vp create threw the following error:

node:internal/modules/cjs/loader:1459
  throw err;
  ^

Error: Cannot find module 'D:\home\.vite-plus\node_modules\vite-plus\dist\bin.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1456:15)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1066:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1071:22)
    at Module._load (node:internal/modules/cjs/loader:1242:25)
    at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)
    at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:154:5)
    at node:internal/main/run_main_module:33:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

I then updated __vp_bin in /d/home/.vite-plus/env from "/d/home/.vite-plus/bin" to "/d/home/.vite-plus/current/bin", which allowed the vp create command to proceed interactively.

New Issue: When creating a Library project using vp create, it fails during the Generating project stage. The logs are as follows:

VITE+ - The Unified Toolchain for the Web

  Vite+ Library

◇ Package name:
  vp-demo

◇ Which package manager would you like to use?
  pnpm

◇ Which agents are you using?
  OpenCode

◇ Which editor are you using?
  VSCode

◇ Set up pre-commit hooks to run formatting, linting, and type checking with auto-fixes?
  Yes

◐  Generating project (5s)
ENOENT: no such file or directory, open 'D:\projects\work\vp-demo\package.json'
Error: ENOENT: no such file or directory, open 'D:\projects\work\vp-demo\package.json'
    at Object.readFileSync (node:fs:440:20)
    at readJsonFile (file:///D:/home/.vite-plus/0.1.12/node_modules/.pnpm/vite-plus@0.1.12_vite@8.0.0/node_modules/vite-plus/dist/global/json-BRdVJ52a.js:130:21)
    at editJsonFile (file:///D:/home/.vite-plus/0.1.12/node_modules/.pnpm/vite-plus@0.1.12_vite@8.0.0/node_modules/vite-plus/dist/global/json-BRdVJ52a.js:144:27)
    at setPackageName (file:///D:/home/.vite-plus/0.1.12/node_modules/.pnpm/vite-plus@0.1.12_vite@8.0.0/node_modules/vite-plus/dist/global/create.js:3237:2)
    at executeBuiltinTemplate (file:///D:/home/.vite-plus/0.1.12/node_modules/.pnpm/vite-plus@0.1.12_vite@8.0.0/node_modules/vite-plus/dist/global/create.js:3489:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
    at async main (file:///D:/home/.vite-plus/0.1.12/node_modules/.pnpm/vite-plus@0.1.12_vite@8.0.0/node_modules/vite-plus/dist/global/create.js:4134:12) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'D:\\projects\\work\\vp-demo\\package.json'
}
Failed to generate code: ENOENT: no such file or directory, open 'D:\projects\work\vp-demo\package.json'

■ Canceled (0s)

Reproduction

none

Steps to reproduce

No response

System Info

VITE+ - The Unified Toolchain for the Web

Environment:
  Version  24.14.0
  Source   lts

Tool Paths:
  node  D:/home/.vite-plus\js_runtime\node\24.14.0\node.exe
  npm   D:/home/.vite-plus\js_runtime\node\24.14.0\npm.cmd
  npx   D:/home/.vite-plus\js_runtime\node\24.14.0\npx.cmd

Used Package Manager

pnpm

Logs

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Priority

    None yet

    Effort

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions