0

想学习一下vue-hackernews-2.0这个例子,就从github上clone了一份。
运行npm install后提示

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN extract-text-webpack-plugin@2.1.2 requires a peer of webpack@^2.2.0 but none is installed. You must install peer dependencies yourself.
npm WARN sw-precache-webpack-plugin@0.10.1 requires a peer of webpack@^1 || ^2 || ^2.1.0-beta || ^2.2.0-beta but none is installed. You must install peer dependencies yourself.

我安装着webpack3应该没什么影响。

然后我npm run dev提示正常

> vue-hackernews-2.0@ dev /Users/fuckc/Documents/vue-hackernews-2.0
> node server

server started at localhost:8080


 DONE  Compiled successfully in 2518ms                                            19:15:38



 DONE  Compiled successfully in 2818ms                                            19:15:38

webpack built 1345b8affebfcb6afefa in 2818ms

但是网页却没有弹出来,
我又执行了npm run buildnpm start依然没有弹出网站,
请问这是什么情况?

查看全部 5 个回答

0

我也是

推荐答案

1

已采纳

这个是因为获取数据的网站https://hacker-news.firebasei... 无法访问导致无法获取数据
可以看下官方的提问
[官方issues] https://github.com/vuejs/vue-...
需要对终端翻墙,教程链接https://juejin.im/entry/58d29...
我参考(照搬)了大神的[beauty-enjoy] https://github.com/beauty-enj... 仓库,删除了firebase相关的配置和原先的页面,初衷是为了当做自己以后搭建ssr项目初始化。
【项目地址】https://github.com/MrSuperJ/a...
可以和尤大以及beauty项目对比,帮助新手更快理解vue-ssr吧~!