简体   繁体   English

无法打开反应基础入门项目

[英]Cannot open the react-foundation starter project

I'm new to React and Node, so I apologize ahead of time if this question shows a high level of ignorance when it comes to the subject. 我是React和Node的新手,所以如果这个问题对这个主题表现出很高的无知,我会提前道歉。 I'm trying to use the react-foundation library, and they provide a starter boilerplate at this link: https://github.com/nordsoftware/react-starter . 我正在尝试使用react-foundation库,并且它们在此链接上提供了入门模板: https : //github.com/nordsoftware/react-starter I follow the directions to 我遵循指示

  1. Install the dependencies using "npm install" 使用“ npm install”安装依赖项
  2. Start the development server with "npm start". 通过“ npm start”启动开发服务器。

I cannot figure out how to get the page to open in my browser. 我无法弄清楚如何在浏览器中打开页面。 I tried making a server.js file, and running "node server.js," but I get a "Cannot GET /" error. 我尝试制作一个server.js文件,并运行“ node server.js”,但出现“无法获取/”错误。 I do not know how I can open this in by the browser. 我不知道如何通过浏览器打开它。

When you "npm start", it should tell you where webpack-dev-server is serving at in the console log. 当您“ npm start”时,它应该告诉您webpack-dev-server在控制台日志中的服务位置。 Otherwise, I can see this in the webpack config file, dev mode: 否则,我可以在开发人员模式的webpack配置文件中看到以下内容:

development.entry.app.push('webpack-dev-server/client?http://localhost:8080'); 

( https://github.com/nordsoftware/react-starter/blob/develop/webpack/development.js ) https://github.com/nordsoftware/react-starter/blob/develop/webpack/development.js

So try pointing your browser to localhost:8080 . 因此,尝试将浏览器指向localhost:8080 You don't need a supplementary server.js file. 您不需要补充的server.js文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM