next.js 安装绑带

u0sqgete  于 2023-04-30  发布在  其他
关注(0)|答案(3)|浏览(111)

我使用Yarn作为我的包管理器。我试图安装strapi项目,但总是有这个错误。

C:\Users\Asus\blog-strapi>yarn create strapi-app backend --quickstart --template https://github.com/strapi/strapi-template-blog
yarn create v1.22.17
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...

success Installed "create-strapi-app@4.0.5" with binaries:
      - create-strapi-app
Creating a quickstart project.
Creating a new Strapi application at C:\Users\Asus\blog-strapi\backend.
Creating files.
Error: ⛔️ Template installation failed: Command failed: C:\WINDOWS\system32\cmd.exe /q /s /c "npm view https://github.com/strapi/strapi-template-blog name version --silent"

    at createProject (C:\Users\Asus\AppData\Local\Yarn\Data\global\node_modules\@strapi\generate-new\lib\create-project.js:82:15)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async createQuickStartProject (C:\Users\Asus\AppData\Local\Yarn\Data\global\node_modules\@strapi\generate-new\lib\create-quickstart-project.js:23:3)
error Command failed.
Exit code: 1
Command: C:\Users\Asus\AppData\Local\Yarn\bin\create-strapi-app
Arguments: backend --quickstart --template https://github.com/strapi/strapi-template-blog
Directory: C:\Users\Asus\blog-strapi
Output:

info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
h79rfbju

h79rfbju1#

如果在创建strapi时使用模板,则不需要传递--quickstart标记
下面是一些使用模板的示例

# Shorthand
yarn create strapi-app my-project --template strapi/blog

# Shorthand with username omitted since it defaults to strapi
yarn create strapi-app my-project --template blog

# Full GitHub URL
yarn create strapi-app my-project --template https://github.com/strapi/strapi-template-blog

来源:Strapi Doc Template Install

pb3s4cty

pb3s4cty2#

你不需要--quickstart标签,根据strapi doc,用模板创建新项目的命令如下:
yarn create strapi-app my-project --template <template-github-name>
在这些示例中,template-github-name参数可以有不同的形式:

  • 速记法。如果一个名为paul的Github用户有一个名为strapi-template-restaurant的仓库,那么简写为paul/restaurant。只有当仓库的名称以strapi-template-开头时才有效。
  • 一个URL。只需粘贴GitHub仓库的URL即可。即使存储库没有前缀strapi-template-,它也能工作。

当使用简写时,如果用户名被省略,CLI将假定它是strapi。因此,以下命令是等价的:

# Shorthand
yarn create strapi-app my-project --template strapi/blog

# Shorthand with username omitted since it defaults to strapi
yarn create strapi-app my-project --template blog

# Full GitHub URL
yarn create strapi-app my-project --template https://github.com/strapi/strapi-template-blog

以下是可用于项目的Strapi模板列表

c8ib6hqw

c8ib6hqw3#

安装步骤:

  1. typenpx create-strapi-app@latest project-Name --quickstart
    在“项目名称”的地方,你必须提到你自己的项目名称
    1.它将自行安装完整的Quickstart模块,并打开浏览器窗口,您必须在其中注册帐户或登录
    1.确保您在当前日期具有正确的节点版本,节点版本要求小于18。x.x
    要再次运行Strapi,请输入npm run develope
    在您的情况下,您不需要使用**--quickstart**安装相同的

相关问题