使用从其他开发人员那里挑选的react.js来开发Web应用程序。当前,尝试使用AWS Amplify,而我最终将使用AWS Cognito进行身份验证。
我正在使用以下教程:https://hackernoon.com/react-authentication-in-depth-4deebda9aa45
我已经执行了以下命令:
$ npm i -g @aws-amplify/cli
$ amplify configure
我已经使用amplify config命令设置了CLI,其中包括设置环境,访问密钥ID和秘密访问密钥。
运行后出现错误
$ amplify init
我已经看到过堆栈溢出的帖子,指出这是CLI的已知错误,并且已在最新版本的CLI中实现了修复程序。我试过更新放大并重新安装。这是我第二次尝试重新安装。
这是终端中错误的副本。
MacBook-Air% amplify init
Note: It is recommended to run this command from the root of your app directory
? Do you want to use an existing environment? Yes
? Choose the environment you would like to use: discrete
Using default provider awscloudformation
✖ There was an error initializing your environment.
init failed
{ AccessDenied: Access Denied
at Request.extractError (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/services/s3.js:585:35)
at Request.callListeners (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
at Request.emit (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
at Request.emit (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/request.js:683:14)
at Request.transition (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/request.js:22:10)
at AcceptorStateMachine.runTo (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/state_machine.js:14:12)
at /usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/state_machine.js:26:10
at Request.<anonymous> (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/request.js:38:9)
at Request.<anonymous> (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/request.js:685:12)
at Request.callListeners (/usr/local/lib/node_modules/@aws-amplify/cli/node_modules/aws-sdk/lib/sequential_executor.js:116:18)
message: 'Access Denied',
code: 'AccessDenied',
region: null,
time: 2019-05-01T18:09:17.901Z,
requestId: '7814262360A7DF07',
extendedRequestId:
'Y1woT4qs3VOtSCQG7sWNu7zexB2O+ZNP3oiBugTdfkHbK4Um5vzOS05P5qsZRcRFUPVTAbey8Q0=',
cfId: undefined,
statusCode: 403,
retryable: false,
retryDelay: 155.200421877319 }
期望环境能够正确初始化和放大以正确配置。
答案 0 :(得分:0)
您可以检查github项目上报告的那些问题。
我们在aws Amplify Console上使用'@ aws-amplify / cli'版本为'2.0.0'时遇到了类似的问题。
我们的环境开发,公关等都很好,但主人却没有。
因此,我们将版本从2.0.0更改为4.0.0,然后重新开始构建。
检查
Console broken again (probably related to aws-amplify/cli 2.0.0)