YAMLException: bad indentation of a mapping entry (105:23) 102 | # Deployment 103 | ## Docs: https://hexo.io/docs/one-command-deployment 104 | deploy: 105 | type: git repository: git@github.com:Cici-Cici/laij ...
时间: 2024-04-11 09:30:33 浏览: 10
这个错误是由于 YAML 文件中的缩进问题引起的。根据错误消息,问题出现在第105行的第23个字符位置。
在 YAML 中,缩进是非常重要的,它用于表示层级关系。在你的示例中,`type` 和 `repository` 键应该是 `deploy` 键下的子键,因此需要正确的缩进。请确保在 `type` 和 `repository` 前面有两个空格的缩进,像这样:
```
deploy:
type: git
repository: git@github.com:Cici-Cici/laij ...
```
检查并修复缩进后,再次运行代码,该错误应该会消失。
相关问题
YAMLException: bad indentation of a mapping entry (106:13) 103 | ## Docs: https://hexo.io/docs/one-command-d ... 104 | deploy: 105 | type:git 106 | repository: git@github.com:Cici-Cici/laij ... -------------------^ 107 | branch: master
这个错误是由于 YAML 文件中的缩进问题导致的。根据错误提示,问题出现在第106行的第13个字符位置。在这个位置上,键 `repository` 的缩进不正确,导致 YAML 解析器无法正确识别该键和其对应的值。
正确的缩进应该是在 `deploy` 下面增加四个空格,使其与上一行的 `type` 对齐。修改后的代码如下:
```yaml
deploy:
type: git
repository: git@github.com:Cici-Cici/laij ...
branch: master
```
请注意,YAML 对缩进非常敏感,因此确保在编辑 YAML 文件时保持一致的缩进风格,一般建议使用两个空格或四个空格作为缩进。
/etc/netplan/01-network-manager-all.yaml:11:7: Invalid YAML: inconsistent indentation:是什么问题
该错误提示 `/etc/netplan/01-network-manager-all.yaml:11:7: Invalid YAML: inconsistent indentation` 指出在 YAML 文件的第11行第7个字符处存在不一致的缩进。
在 YAML 文件中,缩进非常重要,因为它用于表示数据结构的层次结构。每一级别的缩进通常使用空格进行表示,而不是制表符。
请检查您的 `/etc/netplan/01-network-manager-all.yaml` 文件的第11行,并确保在该位置使用一致的缩进。
示例:
```yaml
network:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: true
addresses:
- 192.168.1.10/24
gateway4: 192.168.1.1
```
在上面的示例中,每一级别都使用两个空格进行缩进。确保您的文件中的缩进方式与示例类似,并且在整个文件中保持一致。
如果您仍然遇到问题,可以将您的 YAML 文件内容粘贴在问题中,以便我可以更详细地帮助您诊断问题。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)