错误,当 运行: npx create-next-app -e with-tailwindcss my-project

Error, when running: npx create-next-app -e with-tailwindcss my-project

当我尝试创建新的 Next.js Tailwind 'App'(使用此命令:npx create-next-app -e with-tailwindcss my-project)时,出现以下错误:

C:\socialmedia3>npx create-next-app -e with-tailwindcss socialmedia3
Creating a new Next.js app in C:\socialmedia3\socialmedia3.

Downloading files for example with-tailwindcss. This might take a moment.

Installing packages. This might take a couple of minutes.

Der Befehl "yarn" ist entweder falsch geschrieben oder
konnte nicht gefunden werden. // This is German and means something like: The command "yarn" is either misspelled or could not be found.
node:events:368
      throw er; // Unhandled 'error' event
      ^

Error: spawn yarn ENOENT
    at notFoundError (C:\Users\jesse\AppData\Local\npm-cache\_npx\efeac22998af9bf2\node_modules\create-next-app\dist\index.js:100:3828)
    at verifyENOENT (C:\Users\jesse\AppData\Local\npm-cache\_npx\efeac22998af9bf2\node_modules\create-next-app\dist\index.js:100:4207)
    at ChildProcess.e.emit (C:\Users\jesse\AppData\Local\npm-cache\_npx\efeac22998af9bf2\node_modules\create-next-app\dist\index.js:100:4062)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
Emitted 'error' event on ChildProcess instance at:
    at ChildProcess.e.emit (C:\Users\jesse\AppData\Local\npm-cache\_npx\efeac22998af9bf2\node_modules\create-next-app\dist\index.js:100:4103)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12) {
  code: 'ENOENT',
  errno: 'ENOENT',
  syscall: 'spawn yarn',
  path: 'yarn',
  spawnargs: [ 'install' ]
}

我做错了什么?祝福。

您通过 npx 使用的库似乎需要安装 yarn 而不是。

您可以使用 npm i -g yarn 安装它。