koa-router版本是7.1.1问题
来源:7-3 第七天 兼容PC注册登录和首页(下)
vincents
2017-12-02
我路由按照老师那种Generator函数的写法,结果路由就是进不去,老师您贴出来的koa-router版本也是7.1.1跟koa是2.2.0。怎么会是那种写法呢?我看了官方koa-router的路由写法完全跟您写的不一样,不知道您的项目是否能跑起来,还是说您给我的package.json是不对的。教程跟到最后面,觉得坑好多啊。能不能照顾下我们后面学的,很多是跑不通的,估计很多同学半路就学不下去了。我是一步一点的跟,哪怕有任何问题我都会找出来,就是效率太低了,有些意想不到的Bug就是因为版本问题,真的是烦啊。老师后面您会给源码吗?我就想本地跑一下,能跑通就好。至少让我有学习下去的动力啊!我把您给的package.json贴一下:
{
"name": "wechat",
"version": "1.0.0",
"description": "",
"main": "app.js",
"dependencies": {
"bcrypt": "^0.8.5",
"bluebird": "^3.5.0",
"co": "^4.6.0",
"ejs": "^2.3.4",
"express": "^4.13.3",
"heredoc": "^1.3.1",
"koa": "^2.2.0",
"koa-body": "^2.0.1",
"koa-bodyparser": "^4.2.0",
"koa-router": "^7.1.1",
"koa-session": "^5.0.0",
"koa-views": "^4.1.0",
"lodash": "^4.17.4",
"moment": "^2.11.2",
"mongoose": "^4.9.8",
"pug": "^2.0.0-rc.1",
"raw-body": "^2.1.4",
"request": "^2.81.0",
"sha1": "^1.1.1",
"xml2js": "^0.4.13"
},
"devDependencies": {
"nodemon": "^1.11.0"
},
"scripts": {
"dev": "nodemon -w app.js -w ./app -w ./wx -w ./wechat --exec node app.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Scott",
"license": "ISC"
}
1回答
-
Scott
2017-12-02
032017-12-08
相似问题