Yaml无效:此处不允许映射值
在AWS elastic beanstalk上部署react应用程序时,有人能帮我找出以下错误吗Yaml无效:此处不允许映射值,yaml,amazon-elastic-beanstalk,Yaml,Amazon Elastic Beanstalk,在AWS elastic beanstalk上部署react应用程序时,有人能帮我找出以下错误吗 2019-08-01 04:37:21 ERROR The configuration file .ebextensions/nodecommand. config in application version app-5466-190801_100700 contains invalid YAML or JS ON. YAML exception: Invalid Yaml: mappi
2019-08-01 04:37:21 ERROR The configuration file .ebextensions/nodecommand.
config in application version app-5466-190801_100700 contains invalid YAML or JS
ON. YAML exception: Invalid Yaml: mapping values are not allowed here
in "<reader>", line 3, column 16:
option_settings:
^
, JSON exception: Invalid JSON: Unexpected character (/) at position 0.. Update
the configuration file.
2019-08-01 04:37:21 ERROR Failed to deploy application.
更新-
我按照此链接在AWS elastic beanstalk上部署React应用程序,但仍停留在上述错误上-
这是链接教程中显示的内容:
option_settings:
aws:elasticbeanstalk:container:nodejs:
NodeCommand: "node server.compiled.js"
这是您问题中的YAML:
option_settings:
aws: elasticbeanstalk:container:nodejs:
NodeCommand: "node server.compiled.js"
你能看出区别吗
扰流板:您在aws:
后面加了一个空格。这导致YAML解析器假定aws:
是一个值为“elasticbeanstalk:container:nodejs:
的映射键。但是,下一行也以映射键(NodeCommand
)开头,缩进更多,只有在前一行是没有值的映射键时才允许缩进
如果删除空格,则将其
aws:elasticbeanstalk:container:nodejs
作为映射键,并将以下行作为其值。非常感谢您的回复@Jordan,让我们修复并尝试它。@SachinVairagi您修复了此问题吗?我遇到了同样的错误。但是同样的配置(aws:和行的其余部分之间没有空格)以前对我有效。现在我和你有同样的问题。
option_settings:
aws: elasticbeanstalk:container:nodejs:
NodeCommand: "node server.compiled.js"