go - Go gqlgen command not found 发生
问题描述
我正在学习 Go 和 GraphQL。
我正在构建一个 Go 环境,但是当我运行gqlgen init
命令时,我在终端中收到了一条消息bash: gqlgen: command not found
当我运行 gqlgen init 命令时,终端中出现了一条消息。
执行的命令
$ mkdir with-apollo-api
$ cd with-apollo-api
$ go mod init github.com/yuuu/with-apollo-api
$ go get github.com/99designs/gqlgen
$ go get github.com/rs/cors
# Generate graph/schema.graphqls with gqlgen
$ gqlgen init
解决方案
您没有将 gqlgen 作为可执行文件提供,而是作为项目中的依赖项提供。
安装可执行文件运行
go install github.com/99designs/gqlgen
它将安装可执行文件,现在您可以使用它了
gqlgen init
推荐阅读
- typescript - 未找到此依赖项 - TypeScript、Vue
- android - RecyclerView LinearLayoutManager 的 findLastCompletelyVisibleItemPosition() 与 findLastVisibleItemPosition() 方法
- batch-file - 创建批处理文件以将日志分类到各自的月年文件夹中......?
- laravel - Laravel txt 文件未上传
- php - 用外键删除表
- sql - 为什么我的浮点数在 postgreSQL 中显示为 0
- java - 尝试在我的 ListView 中显示带有 toast 功能的按钮
- angular - 错误说我的活动课程不完整,但它是角度 5
- angular - 从Angular 4中的下拉列表中过滤表格
- apache-kafka - Kafka 主题未收到消息且未被删除