如何从本地锅炉模板创建无服务器模板
How do I create a serverless template from a local boiler template
我在本地保存了一个锅炉模板。如何使用它创建模板?我尝试了以下命令,但没有用:
serverless create --template-path '.\Boiler plate\' --name UserRegistration
我收到以下错误:
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
at validateString (internal/validators.js:120:11)
at Object.join (path.js:375:7).....
.........
None 我在网上找到的解决方案对我有用。
错误提示无服务器命令参数 path
未定义。在 serverless create
documentation page 上,列出了一个示例:
serverless create --template-path path/to/my/template/folder --path path/to/my/service --name my-new-service
This will copy the path/to/my/template/folder folder into path/to/my/service and rename the service to my-new-service.
为了解决您的问题,您需要提供指向本地 Serverless 模板的有效 template-path
,并提供一个 'target path' 使用 --path
,您的模板将被复制到该模板.所以你的命令可能看起来像这样:
serverless create --template-path '.\Boiler plate' --path /target/for/your/template.yml --name UserRegistration
注意:我没有在这个命令中调整'.\Boiler plate\'
。您确定在 .
之后使用反斜杠 \
是正确的吗?
我在本地保存了一个锅炉模板。如何使用它创建模板?我尝试了以下命令,但没有用:
serverless create --template-path '.\Boiler plate\' --name UserRegistration
我收到以下错误:
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
at validateString (internal/validators.js:120:11)
at Object.join (path.js:375:7).....
.........
None 我在网上找到的解决方案对我有用。
错误提示无服务器命令参数 path
未定义。在 serverless create
documentation page 上,列出了一个示例:
serverless create --template-path path/to/my/template/folder --path path/to/my/service --name my-new-service
This will copy the path/to/my/template/folder folder into path/to/my/service and rename the service to my-new-service.
为了解决您的问题,您需要提供指向本地 Serverless 模板的有效 template-path
,并提供一个 'target path' 使用 --path
,您的模板将被复制到该模板.所以你的命令可能看起来像这样:
serverless create --template-path '.\Boiler plate' --path /target/for/your/template.yml --name UserRegistration
注意:我没有在这个命令中调整'.\Boiler plate\'
。您确定在 .
之后使用反斜杠 \
是正确的吗?