为什么“docusaurus”不被识别为内部或外部命令?

问题描述 投票:0回答:1

我正在尝试运行一个简单的 React 项目

纱线开始

yarn run v1.22.22
docusaurus start
'docusaurus' is not recognized as an internal or external command,
operable program or batch file.
error Command failed with exit code 1.

为什么?

纱线全球清单向我们展示

yarn global v1.22.22info "[email protected]" has binaries:docusaurus-startdocusaurus-builddocusaurus-publishdocusaurus-examplesdocusaurus-write-translationsdocusaurus-versiondocusaurus-rename-versionDone in 0.69s.

如何解决这个问题?

我正在尝试按照官方文档设置 Docsaurus 网站 文字

我正在提供我的依赖项,我很好奇它们应该是什么样子。

  "devDependencies": {
    "@algolia/client-search": "^4.24.0",
    "@aws-sdk/client-s3": "^3.511.0",
    "@aws-sdk/credential-providers": "3.511.0",
    "@aws-sdk/signature-v4-crt": "^3.511.0",
    "@babel/helper-get-function-arity": "^7.16.7",
    "@docusaurus/core": "^2.4.1",
    "@docusaurus/preset-classic": "^2.4.1",
    "@docusaurus/theme-mermaid": "^2.4.1",
    "@mdx-js/react": "^1.6.21",
    "@types/react": "^16.8.0",
    "buffer": "^6.0.3",
    "cli-progress": "3.12.0",
    "clsx": "^2.0.0",
    "configure-webpack": "file:plugins/configure-webpack",
    "eslint": "9.2.0",
    "jest": "^29.7.0",
    "util": "^0.12.5",
    "webpack": "5.93.0"
  },
  "dependencies": {
    "mermaid": "^10.3.1",
    "react": "^17.0.2",
    "react-dom": "^17.0.0",
    "rehype-katex": "5",
    "remark-math": "3"
  },

yarn 应该如何提供更多关于到底出了什么问题的信息?

yarnpkg
1个回答
0
投票

尝试确保 docusaurus core 和 classic 都安装在您的项目中本地

yarn add @docusaurus/core @docusaurus/preset-classic

另外看看它是否以

开头
yarn add @docusaurus/core @docusaurus/preset-classic

如果这不起作用,请检查 package.json 以确保启动脚本位于其中。有时我只是运行

yarn install --force
来重新安装所有依赖项

© www.soinside.com 2019 - 2024. All rights reserved.