Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无法运行 #1

Closed
sys2007 opened this issue Oct 20, 2016 · 7 comments
Closed

无法运行 #1

sys2007 opened this issue Oct 20, 2016 · 7 comments
Labels

Comments

@sys2007
Copy link

sys2007 commented Oct 20, 2016

clone后
npm run dev正常
页面访问不到。

@lanhaoxiang
Copy link
Owner

有log吗?

@lanhaoxiang
Copy link
Owner

lanhaoxiang commented Oct 20, 2016

@sys2007

npm install安装依赖
需要全局安装babel和webpack
npm run dev成功后会有类似下面的提示:

webpack built 6c3ccd08e8da04e2f73e in 5498ms
Hash: 6c3ccd08e8da04e2f73e
Version: webpack 1.13.1
Time: 5498ms
                                                Asset       Size  Chunks             Chunk Names
           assets/js/manifest.6c3ccd08e8da04e2f73e.js    24.3 kB       0  [emitted]  manifest
             assets/js/vendor.6c3ccd08e8da04e2f73e.js    1.22 MB    1, 0  [emitted]  vendor
              assets/js/index.6c3ccd08e8da04e2f73e.js    90.4 kB    2, 0  [emitted]  index
assets/css/index.5b24684bdddd7441646620dd2699bfa2.css  177 bytes    2, 0  [emitted]  index
Child extract-text-webpack-plugin:

Child extract-text-webpack-plugin:

Child extract-text-webpack-plugin:

Child extract-text-webpack-plugin:

webpack: bundle is now VALID.

如果有问题可以检查一下下面两点:

  1. 是不是webpack编译报错
  2. 看看前端的网络请求,以及Console

@sys2007
Copy link
Author

sys2007 commented Oct 20, 2016

感谢你的回复。
我是初学者,想学习下你的程序。

刚看了下原来是服务没启来。
是这样的,我第一次运行时报错应该是我在windows下配置NODE_ENV的问题
我把package.jsoon改为
"dev": "set NODE_ENV=development PORT=3000 node bin/www",
然后启动服务没报错,但是没有启动成功,我没注意到。
后来改为
"dev": "set NODE_ENV=development PORT=3000 && node bin/www",
启动成功。
但页面为什么看不到东西呢?
title已经正常了。
http://127.0.0.1:3000/
http://127.0.0.1:3000/tab1
没有内容。

再次感谢你的回复。

在 2016-10-20 11:49:01,"Lan, Haoxiang" notifications@github.com 写道:

@sys2007

先npm install安装依赖
需要全局安装babel和webpack
npm run dev`成功后会有类似下面的提示:

webpack built 6c3ccd08e8da04e2f73e in 5498ms
Hash: 6c3ccd08e8da04e2f73e
Version: webpack 1.13.1
Time: 5498ms
Asset Size Chunks Chunk Names
assets/js/manifest.6c3ccd08e8da04e2f73e.js 24.3 kB 0 [emitted] manifest
assets/js/vendor.6c3ccd08e8da04e2f73e.js 1.22 MB 1, 0 [emitted] vendor
assets/js/index.6c3ccd08e8da04e2f73e.js 90.4 kB 2, 0 [emitted] index
assets/css/index.5b24684bdddd7441646620dd2699bfa2.css 177 bytes 2, 0 [emitted] index
Child extract-text-webpack-plugin:

Child extract-text-webpack-plugin:

Child extract-text-webpack-plugin:

Child extract-text-webpack-plugin:

webpack: bundle is now VALID.

如果有问题可以检查一下下面两点:

是不是webpack编译报错
看看前端的网络请求,以及Console


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@lanhaoxiang
Copy link
Owner

@sys2007

先看一下node的版本,建议使用4.0以上版本
另外windows上babel和webpack可能不太好用
所以建议在*inux或者mac上使用哈

你的问题可能还需要自己看一下网络请求,看是不是资源都是404。
然后后台check一下服务端是否编译是成功的,访问时候有没有错误日志

@sys2007
Copy link
Author

sys2007 commented Oct 20, 2016

看了下babel和webpack都是最新的。
我重新编译了下现在页面有内容了。

但注意到
npm run dev时只有

vue-webpack@1.0.0 dev D:\Work\WorkSpace\NodeJs_WorkSpace\vue-webpack
set NODE_ENV=development PORT=3000 && node bin/www

没有后面的输出。
是不是正常呢?
还有我看了网络包情况
Request URL:
http://127.0.0.1:3000/__webpack_hmr
这个是404
页面是不是这样的?
感谢回复.

在 2016-10-20 12:59:30,"Lan, Haoxiang" notifications@github.com 写道:

@sys2007

先看一下node的版本,建议使用4.0以上版本
另外windows上babel和webpack可能不太好用
所以建议在*inux或者mac上使用哈

你的问题可能还需要自己看一下网络请求,看是不是资源都是404。
然后后台check一下服务端是否编译是成功的,访问时候有没有错误日志


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@lanhaoxiang
Copy link
Owner

@sys2007

如果启动后没有输出说明是不正常的
development环境下启动后会用webpack编译各个模块
然后启动一个express服务

你的node是什么版本? 如果是4.0以上的话建议删除掉node_modules然后重新npm install,看看是不是安装时候出错了

@sys2007
Copy link
Author

sys2007 commented Oct 20, 2016

看样子界面是正常的。

下面是编译和运行

感谢回复

在 2016-10-20 13:15:47,"Lan, Haoxiang" notifications@github.com 写道:

@sys2007

如果启动后没有输出说明是不正常的
development环境下启动后会用webpack编译各个模块
然后启动一个express服务

你的node是什么版本? 如果是4.0以上的话建议删除掉node_modules然后重新npm install,看看是不是安装时候出错了


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants