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

npm run build --report 报错 #7

Open
killerlei opened this issue Mar 27, 2017 · 3 comments
Open

npm run build --report 报错 #7

killerlei opened this issue Mar 27, 2017 · 3 comments

Comments

@killerlei
Copy link

第一个问题
npm run build --report 运行后
ERROR in static/js/0.8d18fe144f17fc217b92.js from UglifyJs
Unexpected token punc «(», expected punc «:» [static/js/0.8d18fe144f17fc217b92.js:45,8]
报了几个这样的错误
是ES6缺少babel的原因吗

第二个问题
node server.js运行后
显示
Server running in port 3000
Mongodb started successfully
但是打开http://127.0.0.1:3000/
显示Error: This page not found
是第一个原因的问题引起的吗

@ykloveyxk
Copy link
Owner

第一个问题是打包后es6支持有问题,你可以看一下它提示的那个文件。

第二个问题是因为127.0.0.1:3000是后台服务端,本身没有页面,它只是处理前台发回去的数据并返回结果给前台而已,在server.js中有写

@killerlei
Copy link
Author

killerlei commented Mar 28, 2017

@ykloveyxk
不好意思
第二个问题还是不明白
启动服务后 我怎么在浏览器访问到页面?
http://127.0.0.1:3000/不是默认访问到index.html吗
另外路由接口如下
module.exports = (router) => {
router.post('/register', Register),
router.post('/login', Login),
router.get('/user', checkToken, User),
router.post('/delUser', checkToken, delUser)
}
访问http://127.0.0.1:3000/user也没界面
不是太懂 麻烦了

@yoga1314
Copy link

@killerlei 请问你第一个问题是怎么解决的

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

No branches or pull requests

3 participants