node.js - AWS Amplify 教程无法启动客户端应用程序

标签 node.js amazon-web-services serverless aws-amplify aws-amplify-sdk-js

我正在尝试按照 AWS Amplify 教程创建示例 Web 应用程序。
https://docs.amplify.aws/start/getting-started/installation/q/integration/react

当我完成在本地运行客户端前端的步骤时,我收到了很长的错误列表。

我在 WSL 上使用 npm 3.5.2。

Failed to compile.

Error in ./src/App.js
Module not found: 'aws-amplify-react' in /home/efrontier/projects/amplify-webinar/src

 @ ./src/App.js 20:23-51

Error in ./~/@aws-sdk/credential-provider-cognito-identity/dist/cjs/fromCognitoIdentityPool.js
Module parse failed: /home/efrontier/projects/amplify-webinar/node_modules/@aws-sdk/credential-provider-cognito-identity/dist/cjs/fromCognitoIdentityPool.js Unexpected token (22:28)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (22:28)
 @ ./~/@aws-sdk/credential-provider-cognito-identity/dist/cjs/index.js 5:21-57

Error in ./~/@aws-sdk/credential-provider-cognito-identity/dist/cjs/fromCognitoIdentity.js
Module parse failed: /home/efrontier/projects/amplify-webinar/node_modules/@aws-sdk/credential-provider-cognito-identity/dist/cjs/fromCognitoIdentity.js Unexpected token (13:20)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (13:20)
 @ ./~/@aws-sdk/credential-provider-cognito-identity/dist/cjs/index.js 4:21-53

Error in ./~/@aws-sdk/client-cognito-identity/dist/cjs/protocols/Aws_json1_1.js
Module parse failed: /home/efrontier/projects/amplify-webinar/node_modules/@aws-sdk/client-cognito-identity/dist/cjs/protocols/Aws_json1_1.js Unexpected token (4:79)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (4:79)
 @ ./~/@aws-sdk/client-cognito-identity/dist/cjs/commands/DeleteIdentitiesCommand.js 3:22-57

Error in ./~/@aws-sdk/client-lex-runtime-service/dist/cjs/protocols/Aws_restJson1_1.js
Module parse failed: /home/efrontier/projects/amplify-webinar/node_modules/@aws-sdk/client-lex-runtime-service/dist/cjs/protocols/Aws_restJson1_1.js Unexpected token (5:78)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (5:78)
 @ ./~/@aws-sdk/client-lex-runtime-service/dist/cjs/commands/DeleteSessionCommand.js 3:26-65

Error in ./~/@aws-sdk/client-pinpoint/dist/cjs/protocols/Aws_restJson1_1.js
Module parse failed: /home/efrontier/projects/amplify-webinar/node_modules/@aws-sdk/client-pinpoint/dist/cjs/protocols/Aws_restJson1_1.js Unexpected token (5:74)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (5:74)
 @ ./~/@aws-sdk/client-pinpoint/dist/cjs/commands/CreateCampaignCommand.js 3:26-65

Error in ./~/@aws-sdk/client-firehose/dist/cjs/protocols/Aws_json1_1.js
Module parse failed: /home/efrontier/projects/amplify-webinar/node_modules/@aws-sdk/client-firehose/dist/cjs/protocols/Aws_json1_1.js Unexpected token (4:81)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (4:81)
 @ ./~/@aws-sdk/client-firehose/dist/cjs/commands/CreateDeliveryStreamCommand.js 3:22-57

Error in ./~/@aws-sdk/client-kinesis/dist/cjs/protocols/Aws_json1_1.js
Module parse failed: /home/efrontier/projects/amplify-webinar/node_modules/@aws-sdk/client-kinesis/dist/cjs/protocols/Aws_json1_1.js Unexpected token (4:76)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (4:76)
 @ ./~/@aws-sdk/client-kinesis/dist/cjs/commands/AddTagsToStreamCommand.js 3:22-57

Error in ./~/idb/build/cjs/index.js
Module parse failed: /home/efrontier/projects/amplify-webinar/node_modules/idb/build/cjs/index.js Unexpected token (66:25)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (66:25)
 @ ./~/@aws-amplify/datastore/lib/storage/adapter/indexeddb.js 85:23-37

Error in ./~/@aws-sdk/client-personalize-events/dist/cjs/protocols/Aws_restJson1_1.js
Module parse failed: /home/efrontier/projects/amplify-webinar/node_modules/@aws-sdk/client-personalize-events/dist/cjs/protocols/Aws_restJson1_1.js Unexpected token (5:74)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (5:74)
 @ ./~/@aws-sdk/client-personalize-events/dist/cjs/commands/PutEventsCommand.js 3:26-65

Error in ./~/@aws-sdk/client-s3/dist/cjs/protocols/Aws_restXml.js
Module parse failed: /home/efrontier/projects/amplify-webinar/node_modules/@aws-sdk/client-s3/dist/cjs/protocols/Aws_restXml.js Unexpected token (7:81)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (7:81)
 @ ./~/@aws-sdk/client-s3/dist/cjs/commands/CopyObjectCommand.js 3:22-57

Error in ./~/@aws-sdk/client-translate/dist/cjs/protocols/Aws_json1_1.js
Module parse failed: /home/efrontier/projects/amplify-webinar/node_modules/@aws-sdk/client-translate/dist/cjs/protocols/Aws_json1_1.js Unexpected token (5:78)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (5:78)
 @ ./~/@aws-sdk/client-translate/dist/cjs/commands/DeleteTerminologyCommand.js 3:22-57

Error in ./~/@aws-sdk/client-polly/dist/cjs/protocols/Aws_restJson1_1.js
Module parse failed: /home/efrontier/projects/amplify-webinar/node_modules/@aws-sdk/client-polly/dist/cjs/protocols/Aws_restJson1_1.js Unexpected token (5:78)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (5:78)
 @ ./~/@aws-sdk/client-polly/dist/cjs/commands/DeleteLexiconCommand.js 3:26-65

Error in ./~/@aws-sdk/client-textract/dist/cjs/protocols/Aws_json1_1.js
Module parse failed: /home/efrontier/projects/amplify-webinar/node_modules/@aws-sdk/client-textract/dist/cjs/protocols/Aws_json1_1.js Unexpected token (5:76)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (5:76)
 @ ./~/@aws-sdk/client-textract/dist/cjs/commands/DetectDocumentTextCommand.js 3:22-57

Error in ./~/@aws-sdk/client-rekognition/dist/cjs/protocols/Aws_json1_1.js
Module parse failed: /home/efrontier/projects/amplify-webinar/node_modules/@aws-sdk/client-rekognition/dist/cjs/protocols/Aws_json1_1.js Unexpected token (5:73)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (5:73)
 @ ./~/@aws-sdk/client-rekognition/dist/cjs/commands/CreateCollectionCommand.js 3:22-57

Error in ./~/@aws-sdk/client-comprehend/dist/cjs/protocols/Aws_json1_1.js
Module parse failed: /home/efrontier/projects/amplify-webinar/node_modules/@aws-sdk/client-comprehend/dist/cjs/protocols/Aws_json1_1.js Unexpected token (5:88)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (5:88)
 @ ./~/@aws-sdk/client-comprehend/dist/cjs/commands/BatchDetectEntitiesCommand.js 3:22-57

Error in ./~/@aws-sdk/signature-v4/dist/cjs/SignatureV4.js
Module parse failed: /home/efrontier/projects/amplify-webinar/node_modules/@aws-sdk/signature-v4/dist/cjs/SignatureV4.js Unexpected token (36:10)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (36:10)
 @ ./~/@aws-sdk/signature-v4/dist/cjs/index.js 5:21-45

Error in ./~/@aws-sdk/node-http-handler/build/node-http2-handler.js
Module not found: 'http2' in /home/efrontier/projects/amplify-webinar/node_modules/@aws-sdk/node-http-handler/build

 @ ./~/@aws-sdk/node-http-handler/build/node-http2-handler.js 3:16-32

Error in ./~/@aws-sdk/credential-provider-process/build/index.js
Module not found: 'child_process' in /home/efrontier/projects/amplify-webinar/node_modules/@aws-sdk/credential-provider-process/build

 @ ./~/@aws-sdk/credential-provider-process/build/index.js 5:22-46

Error in ./~/@aws-sdk/eventstream-serde-node/build/EventStreamMarshaller.js
Module parse failed: /home/efrontier/projects/amplify-webinar/node_modules/@aws-sdk/eventstream-serde-node/build/EventStreamMarshaller.js Unexpected token (39:18)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (39:18)
 @ ./~/@aws-sdk/eventstream-serde-node/build/provider.js 3:32-66

我已经安装了 aws-amplify/cli、aws-amplify、@aws-amplify/ui-react。

你认为我错过了任何软件包或工具吗?谢谢。

最佳答案

npm audit fix --force也为我工作。
我认为这是“ react 脚本”从 1.x 版本到 3.4.3 的升级,但只是一个猜测。

关于node.js - AWS Amplify 教程无法启动客户端应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62324774/

相关文章:

javascript - 每 10 秒运行一次 node.js 脚本

node.js - NodeJS 特定语言语法检查器

javascript - 使用 gulp 在页面上临时添加脚本

无服务器错误 - 没有文件匹配包含/排除模式

javascript - Serverless 无法导入模块 'handler' 错误

javascript - 如何提高JS函数式代码的性能

mysql - 将 .sql 文件从本地主机导入到远程 awd rds

amazon-web-services - 如何从一个 cdk 管道创建多个特定于环境的 cdk 管道?

amazon-web-services - 谷歌标签管理器点击流到亚马逊

amazon-web-services - 无服务器框架输出