问题标签 [aws-cloud9]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
286 浏览

node.js - 在 AWS Cloud9 的 node_modules 中包含一个新模块

我正在使用 AWS cloud9 创建一个网络服务器。我在那里创造了一个环境。它有我的 server.js 和 index.html 页面。我想在 node_modules 中包含 socket.IO 模块。但我无法在 AWS cloud9 中安装 socket.io 包。谁能告诉我在哪里以及如何在其中包含包裹?

在此处输入图像描述

0 投票
0 回答
138 浏览

ruby-on-rails - 从 c9.io 迁移到 AWS Cloud9 后如何修复 rake db:migrate 错误?

我刚刚将我的旧 Rails 项目从 c9.io 迁移到 AWS Cloud9,迁移后,我运行

bundle install

它工作正常,但是当我尝试运行时:

rake db:migrate

发生了这个错误:

/home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in block (2 levels) in <class:Numeric>' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in block (2 levels) in ' /home /ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in block (2 levels) in <class:Numeric>' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in block (2 levels) in ' /home/ec2 -user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in block (2 levels) in <class:Numeric>' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in block (2 levels) in ' /home/ec2-user /.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131 block (2 levels) in <class:Numeric>' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in :在'/home/ec2-user/中的块(2级)。 rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in block (2 levels) in <class:Numeric>' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in '/home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in block (2 levels) in <class:Numeric>' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in 块( 2 个级别)在' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in block (2 levels) in <class:Numeric>' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in 块中(2 个级别) 在 ' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in block (2 levels) in <class:Numeric>' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in 块 (2 级) 中' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in block (2 levels) in <class:Numeric>' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in block (2 levels) in ' / home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in block (2 levels) in <class:Numeric>' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in '/home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in block (2 levels) in <class:Numeric>' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in 块( 2 个级别)在' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in block (2 levels) in <class:Numeric>' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in 块中(2 个级别) 在 ' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in block (2 levels) in <class:Numeric>' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in 块 (2 级) 中' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in block (2 levels) in <class:Numeric>' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in block (2 levels) in ' / home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in block (2 levels) in <class:Numeric>' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in '/home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in block (2 levels) in <class:Numeric>' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in 块( 2 个级别)在' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in block (2 levels) in <class:Numeric>' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in 块中(2 个级别) 在 ' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in block (2 levels) in <class:Numeric>' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in 块 (2 级) 中' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in block (2 levels) in <class:Numeric>' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in block (2 levels) in ' / home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in block (2 levels) in <class:Numeric>' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in '/home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in block (2 levels) in <class:Numeric>' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in 块( 2 个级别)在' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in block (2 levels) in <class:Numeric>' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in 块中(2 个级别) 在'/home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/core_ext/numeric/conversions.rb:131:in block (2 levels) in <class:Numeric>' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/cache/strategy/local_cache.rb:138:in local_cache_key'/home/ec2 -user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/cache/strategy/local_cache.rb:74:in middleware' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/railties-4.2.5/lib/rails/application/bootstrap.rb:79:in block in ' /home/ec2-user/.rvm/ gems/ruby-2.6.0/gems/railties-4.2.5/lib/rails/initializable.rb:30:in instance_exec' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/railties-4.2.5/lib/rails/initializable.rb:30:in run' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/railties -4.2.5/lib/rails/initializable.rb:55: 在block in run_initializers' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/railties-4.2.5/lib/rails/initializable.rb:54:in run_initializers'/home/ec2-user/.rvm/gems/ruby-2.6.0/gems/railties-4.2.5/lib/rails/application.rb:352:in '/home/ec2 initialize!' /home/ec2-user/environment/config/environment.rb:5:in -user/.rvm/ gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in require' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:inblock in require' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems /activesupport-4.2.5/lib/active_support/dependencies.rb:240:inload_dependency' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:in要求' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/railties-4.2.5/lib/rails/ application.rb:328:in require_environment!' /home/ec2-user/.rvm/gems/ruby-2.6.0/gems/railties-4.2.5/lib/rails/application.rb:457:in block in run_tasks_blocks'Tasks: TOP => db:migrate => environment(通过使用--trace运行任务查看完整跟踪)

有谁知道如何解决这个问题?

0 投票
1 回答
1716 浏览

pandas - 将 Athena 中的数据加载到 AWS 中 Cloud9/Lambda 中的 Pandas 数据帧以进行 ETL

我正在 AWS 中构建一个数据湖。源数据作为 CDC 导入 S3。我需要找到一种方法来合并它们,以便拥有一个包含最新版本信息的表格。

最初我想使用 Glue 进行 ETL 开发,但编辑器似乎相当笨重。此外,数据量并没有太大以至于需要火花。Pandas 也将发挥作用,并且在组织中拥有更广泛的知识库。

因此,我使用 Glue 来抓取导入,现在有了 Athena 表,我想在 Cloud9 中开发我的聚合,以便稍后迁移到 Lambda 函数。

问题是我无法将 Athena 数据放入数据框中。

我已经尝试了 boto3 中的 start_query_execution 函数,但它不返回数据,而只是将其写入我不想要的 S3 中。它还作为 QueryExecutionId 返回,我已将其传递给另一个名为 get_query_results 的 boto 函数。似乎有响应,但我在如何将数据传递到数据框(是 JSON 还是 dict?)上苦苦挣扎。

0 投票
1 回答
57 浏览

apache - 将 PHP/Apache 工作区从 Cloud9 迁移到 AWS

不确定这是正确的地方,如果不是,请善待。

我最近将 PHP/Apache 工作区从 Cloud9 迁移到 AWS Cloud9。我遵循了迁移步骤,一切都很好。我有一个包含所有文件的新 AWS Cloud9 工作区……但我无法启动服务器。

之前,我单击运行,Apache 服务器启动。现在,什么也没有发生。我想知道我是否有任何配置要执行?

任何想法 ?

0 投票
1 回答
786 浏览

apache - 如何在 AWS EC2 Cloud9 上运行 Apache

我从 Cloud9 迁移到 AWS Cloud9。我无法看到 Apache 服务器的预览。服务器正在运行:

但是当我尝试预览服务器时,没有任何效果:

  • 本地主机/

客户端关闭请求 499 - AWSCloud9VFSService VFS 连接不存在

  • 本地主机:8080

无法获取 /vfs/80990xxxxxxxxxxxxxxxxxxxxxxxxxxx/previewlocalhost:8080

我已经尝试过了:

https://docs.aws.amazon.com/cloud9/latest/user-guide/app-preview.html#app-preview-app-reload

但它是一个假服务器,不加载根文件index.php。它显示文件夹中的文件列表,不考虑 .htaccess 文件。

我还尝试根据配置 apache 更改 8080 的端口以侦听 80 以外的端口

0 投票
1 回答
976 浏览

apache - 如何在 AWS Cloud9 编辑器中更改我的主要“环境”位置?

我正在使用 AWS Cloud9 学习如何开发 Web 服务器,但主文件菜单卡在~/environment/目录中。我正在尝试为这个“项目”使用 Apache HTTP 服务器。有没有办法可以将左侧显示的主目录更改为 apache 安装位置/var/www/html/

我所说的区域是下图中以黄色突出显示的区域。

截屏

另一个问题是我也无法/var/www/html/在 Ace 编辑器中打开文件。我假设这是因为它位于根目录中。

我什至会就如何将网站的目录从 更改为 采取解决方案,/var/www/html/因为/home/ec2-user/environment/我通过谷歌发现的任何内容都没有帮助。

0 投票
1 回答
303 浏览

node.js - Lambda 函数适用于 AWS 控制台,但不适用于 Cloud9

我正在制作 Alexa 技能,需要包含 nodejs 的其余模块,因此我已从 AWS 控制台更改为云 9。在控制台中,一切正常,但是当我使用完全相同的设置创建项目时(不包括新模块)我收到以下语法错误:

它没有告诉我语法错误发生在哪一行,并且在控制台中使用完全相同的输入它可以正常工作。

我已经尝试减少我的代码,只在我的 index.js 中包含一个 launchRequestHandler :

我还尝试将 package.json 更改为控制台中的内容,并使用 npm init 创建了它,但两者都没有区别。我究竟做错了什么?有什么遗漏吗?

我的 template.yml 看起来像这样:

0 投票
0 回答
121 浏览

node.js - 尝试连接到服务器时,我收到断言 `args[1]->IsString()' failed 错误

我正在尝试使用 node.js 向 Cloud9 中的服务器发送 POST。使用 Postmaster 时,它可以正常工作。我已将其翻译为 node.js 并添加了 http 模块,因此我的相关代码如下所示:

发送帖子时出现以下错误:

我已将 node 更新为v8.15,尝试过npm i natives,因为这些解决方案对其他人有用,但我仍然遇到相同的错误。我也尝试过使用 request 和 Unirest 而不是 http,但是在两者发生任何事情之前连接超时。

0 投票
1 回答
105 浏览

aws-cloud9 - AWS Cloud9 Node Express 可从 Internet 获取

有谁知道如何从互联网连接到 AWS Cloud9 Node.js 应用程序?

我已按照说明设置了安全组和子网。

我只是不知道如何将服务器绑定到 EC2 实例公共 DNS 和端口。

任何帮助表示赞赏。

0 投票
1 回答
127 浏览

javascript - CORB 在 c9 平台上阻止 javascript POST 到 NodeJS 后端

我正在为学校做一个非常简单的项目。我和我的队友选择 AWS-Cloud9 作为我们的平台,随着我们的进步,我学会了动态使用它。我的工作是脚本。我有一个使用 Express 来查询我的数据库的 NodeJS 后端,并且我有一个客户端 JS 将带有表单数据的帖子发送到后端。由于我不明白的原因,我收到以下错误:Cross-Origin Read Blocking (CORB) blocked cross-origin response / Address of my project /search.js with MIME type text/html

在过去的 8 个小时里,我一直在互联网上上下移动,但找不到有效的解决方案。我尝试将 cors 包添加到我的后端,我尝试操作客户端和后端标头

客户端

后端

期望帖子成功拉出响应,然后导致主页 div 在结果页面 div 弹出时隐藏,“虚拟” div 用作响应区域以显示指示后端失败的消息它是请求,或者以其他方式显示响应对象。这是一个测试场景,一旦我通过了这个障碍,我将解析成功返回的响应对象并更准确地操作响应页面