簡體   English   中英

如何從本地鍋爐模板創建無服務器模板

[英]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).....
.........

我在網上找到的所有解決方案都不適合我。

該錯誤表示無服務器命令參數path未定義。 serverless create 文檔頁面上,列出了一個示例,說明:

serverless create --template-path path/to/my/template/folder --path path/to/my/service --name my-new-service

這會將 path/to/my/template/folder 文件夾復制到 path/to/my/service 並將服務重命名為 my-new-service。

為了解決您的問題,您需要提供指向本地無服務器模板的有效template-path ,並使用--path提供模板將被復制到的“目標路徑”。 所以你的命令可能看起來像這樣:

serverless create --template-path '.\Boiler plate' --path /target/for/your/template.yml --name UserRegistration

注意:我沒有在這個命令中調整'.\\Boiler plate\\' 您確定使用反斜杠\\ after 是正確的嗎. ?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM