Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npx vitepress init does not install the vitepress dependency in package.json #2873

Open
glennsc opened this issue Aug 29, 2023 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@glennsc
Copy link

glennsc commented Aug 29, 2023

Describe the bug

Running npx vitepress init and following the default prompts leaves you with a package.json with the vitepress scripts, but no dependency on vitepress itself, so the scripts don't run.

I looked through closed issues and don't see any indication this is by design.

Reproduction

mkdir vp1
cd vp1
npx vitepress init

Take defaults on every prompt. Result:


> vp1 npm run docs:dev

> docs:dev
> vitepress dev

sh: vitepress: command not found

Expected behavior

The vitepress dependency would have been installed.

System Info

System:
    OS: macOS 14.0
    CPU: (8) arm64 Apple M2
    Memory: 1.73 GB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 19.7.0 - ~/Library/Caches/fnm_multishells/49619_1693334605770/bin/node
    Yarn: 1.22.19 - ~/Library/Caches/fnm_multishells/49619_1693334605770/bin/yarn
    npm: 9.6.1 - ~/Library/Caches/fnm_multishells/49619_1693334605770/bin/npm
    pnpm: 8.6.12 - ~/Library/Caches/fnm_multishells/49619_1693334605770/bin/pnpm
  Browsers:
    Chrome: 116.0.5845.140
    Safari: 17.0


### Additional context

_No response_

### Validations

- [X] Check if you're on the [latest VitePress version](https://github.com/vuejs/vitepress/releases/latest).
- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)
- [X] Read the [docs](https://vitepress.dev).
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@glennsc glennsc added the bug: pending triage Maybe a bug, waiting for confirmation label Aug 29, 2023
@brc-dd
Copy link
Member

brc-dd commented Aug 29, 2023

Currently, this is by design. The docs state: "After installation, start the wizard by running: ...". We can do that probably though. I'll have to check why it was not added earlier 👀

@brc-dd brc-dd removed the bug: pending triage Maybe a bug, waiting for confirmation label Aug 29, 2023
@brc-dd brc-dd added the enhancement New feature or request label Sep 25, 2023
@github-actions github-actions bot added the stale label Nov 6, 2023
@ThisIsMissEm
Copy link

This tripped me up too, as many other npx ... commands for creating projects do include the software used in the dependencies, normally you don't need to do npm add -D ... and npx ... init

@github-actions github-actions bot removed the stale label Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants