我正在尝试将AWS Amplify集成到我的Flutter项目中,在Windows上,VS代码。
我通过安装了Amplify CLI
curl -sL https://aws-amplify.github.io/amplify-cli/install-win -o install.cmd && install.cmd
字符串
我运行amplify configure
并创建了一个IAM用户。
但是,在创建一个新的Flutter项目后,运行amplify init
会导致错误:
Error: ENOENT: no such file or directory, open 'C:\Users\Username\AppData\Roaming\SPB_Data\.aws\config'
at Object.openSync (fs.js:462:3)
at Object.openSync (pkg/prelude/bootstrap.js:739:32)
at Object.readFileSync (fs.js:364:35)
at Object.readFileSync (pkg/prelude/bootstrap.js:1025:36)
at Object.readFileSync (C:\snapshot\node_modules\aws-sdk\lib\util.js:95:26)
at IniLoader.parseFile (C:\snapshot\node_modules\aws-sdk\lib\shared-ini\ini-loader.js:6:47)
at IniLoader.loadFrom (C:\snapshot\node_modules\aws-sdk\lib\shared-ini\ini-loader.js:56:30)
at getRegion (C:\snapshot\node_modules\aws-sdk\lib\node_loader.js:116:32)
at Config.region (C:\snapshot\node_modules\aws-sdk\lib\node_loader.js:171:18)
at Config.set (C:\snapshot\node_modules\aws-sdk\lib\config.js:524:39)
at Config.<anonymous> (C:\snapshot\node_modules\aws-sdk\lib\config.js:359:12)
at Config.each (C:\snapshot\node_modules\aws-sdk\lib\util.js:512:32)
at new Config (C:\snapshot\node_modules\aws-sdk\lib\config.js:358:19)
at Object.loadServiceClass (C:\snapshot\node_modules\aws-sdk\lib\service.js:108:16)
at Object.Service [as constructor] (C:\snapshot\node_modules\aws-sdk\lib\service.js:47:29)
at new <anonymous> (C:\snapshot\node_modules\aws-sdk\lib\util.js:629:24)
at getConfiguredAmplifyClient (C:\snapshot\node_modules\amplify-provider-awscloudformation\lib\aws-utils\aws-amplify.js:42:14)
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
errno: -4058,
syscall: 'open',
code: 'ENOENT',
path: 'C:\\Users\\Username\\AppData\\Roaming\\SPB_Data\\.aws\\config'
型
1条答案
按热度按时间dgsult0t1#
我很幸运地注意到.aws文件夹是在C:\Users\Username中生成的,所以我简单地将其复制到C:\Users\Username\AppData\Roaming\SPB_Data中。
现在唯一的问题是,当运行额外的Amplify configure命令时,.aws只在C:\Users\Username中更新,所以我必须记住在每个新配置文件创建后将其复制粘贴到SPB_Data。