unjs / undocs

Minimal Documentation theme and CLI for shared usage across UnJS projects.
https://undocs.pages.dev/
MIT License
143 stars 12 forks source link

download template and has an error #102

Closed xjccc closed 3 months ago

xjccc commented 3 months ago

Environment

node: v20.10.0

Reproduction

  1. pnpm dlx giget gh:unjs/undocs/template docs --install
  2. pnpm dev

Describe the bug

  1. When i use command to dev the project, has this error.

  2. I install nuxt, other command has resolve this error, but pnpm to dev the project, also has error.

Additional context

bug

Logs

No response

pi0 commented 3 months ago

please use bun

xjccc commented 3 months ago

please use bun

Thank you for your quick reply. But i use bun also need nuxt. Its something i forgot for?

pi0 commented 3 months ago

Thanks for confirming. From reproduction above, i saw pnpm dev did you remove node_modules and use bun install to install dependencies? (bun is not strict about dependency hoisting)

xjccc commented 3 months ago

Thanks for confirming. From reproduction above, i saw pnpm dev did you remove node_modules and use bun install to install dependencies? (bun is not strict about dependency hoisting)

Oh, i confirm that. Use bun is correct. Is my fault, i think first i use pnpm install, then use bun has same error. But in docs guide, has these command too, i think its should to be solve? Thank you very much.

cpreston321 commented 3 months ago

@pi0 We could add within the post install script as an option, if not we can make it more clear in the docs.

{
  "scripts": {
    "preinstall": "npx only-allow bun"
  }
}
pi0 commented 3 months ago

before marking undocs as general purpose will will certainly solve this for supporting other package managers but using hooks only makes install time less reliable / slower. (PR welcome to improve emphesasis in README and docs about noting this better)