Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 尝试在ec2实例上运行网站_Reactjs_Amazon Ec2_Web Hosting - Fatal编程技术网

Reactjs 尝试在ec2实例上运行网站

Reactjs 尝试在ec2实例上运行网站,reactjs,amazon-ec2,web-hosting,Reactjs,Amazon Ec2,Web Hosting,我试图在ec2实例上运行一个简单的react/falcon网站,但遇到了一些问题。我怀疑问题在于将该实例面向公众的url指向该网站的登录/主页,但我不能完全确定 我已经为实例配置了入站规则,以允许所有传入的http和https流量,因此我认为这不是权限问题 我觉得我需要在package.json中添加一些东西来让它工作 当我运行npm时,启动以下输出: 编译成功! 现在,您可以在浏览器中查看sapie fe。 本地: 在您的网络上: 请注意,开发构建没有经过优化。 要创建生产构建,请使用npm运

我试图在ec2实例上运行一个简单的react/falcon网站,但遇到了一些问题。我怀疑问题在于将该实例面向公众的url指向该网站的登录/主页,但我不能完全确定

我已经为实例配置了入站规则,以允许所有传入的http和https流量,因此我认为这不是权限问题

我觉得我需要在package.json中添加一些东西来让它工作

当我运行npm时,启动以下输出:

编译成功! 现在,您可以在浏览器中查看sapie fe。 本地: 在您的网络上:

请注意,开发构建没有经过优化。 要创建生产构建,请使用npm运行构建。 但是,当我在浏览器中访问时,什么也没有发生/加载。package.json如下所示:

{
    "name": "sapie-fe",
    "version": "0.1.0",
    "homepage": ".",
    "private": true,
    "dependencies": {
         "amazon-cognito-identity-js": "^1.31.0",
         "axios": "0.17.1",
         "classnames": "^2.2.5",
         "object-path": "^0.11.4",
         "react": "^16.2.0",
         "react-bootstrap": "^0.32.1",
         "react-dom": "^16.2.0",
         "react-rebind": "^0.1.9",
         "react-router": "^4.2.0",
         "react-router-bootstrap": "^0.24.4",
         "react-router-dom": "^4.2.2",
         "react-scripts": "1.0.17",
         "react-stripe-checkout": "^2.6.3",
         "stripe": "^5.4.0"
    },
   "scripts": {
         "start": "react-scripts start",
         "build": "react-scripts build",
         "test": "react-scripts test --env=jsdom",
         "eject": "react-scripts eject"
    },
   "devDependencies": {}
}
我想我应该在这里添加一些东西来让它工作,但我不确定。npm安装产生以下结果:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules/react-scripts/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN react-lorem-component@0.12.2 requires a peer of react@15.x but none was installed.
这些看起来可能是线索,但只是警告,表面上看起来与我在面向公众的url上无法访问的网站无关


非常感谢您提供的任何帮助

必须向所有传入连接打开端口3000,并且可以正常工作。啊

你可以忽略npm警告日志,你是对的。他们没有关系。我会检查你在AWS VPC上暴露的端口。您是否已将端口80映射到端口3000?您使用的是专用ip还是公用ip?