我正在尝试运行一个简单的 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 list 向我们展示了
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 应该如何提供更多有关到底出了什么问题的信息?
尝试确保 docusaurus core 和 classic 都已在项目中本地安装
另外看看它是否以
如果这不起作用,我会检查 package.json 以确保启动脚本在其中。有时我也会运行
yarn install --force
以重新安装所有依赖项