Code Monkey home page Code Monkey logo

jackblog-api-koa's Issues

errorHandleMiddle模块的一些问题

你好,最近在看你的项目,发现server/util/error/index.js下面对于err.errors的处理好像有点问题:

 if(err.errors && typeof(err.errors) === 'object'){
        _.mapValues(err.errors, (item)=>{
          if(item.message){
            error_msg = item.message     //这里这样的处理可能有错误,error_msg只会保存最后一个message
          }
        })
      }

是错误还是故意为之呢?

还有这个中间件如果是因为代码问题抛出的错误,并且没有对错误进行包装处理,是不是会直接把错误发送暴露给客户端呢?

windows下运行报错了

$ gulp serve
[00:06:45] Using gulpfile E:\MyProject\bishe\boke\jackblog-api-koa\gulpfile.js
[00:06:45] Starting 'nodemon'...
[00:06:45] Finished 'nodemon' after 2.27 ms
[00:06:45] Starting 'serve'...
[00:06:45] Finished 'serve' after 7.8 μs
[00:06:45] [nodemon] 1.9.1
[00:06:45] [nodemon] to restart at any time, enter rs
[00:06:45] [nodemon] watching: E:\MyProject\bishe\boke\jackblog-api-koa\server/*/
[00:06:45] [nodemon] starting node --harmony server\app.js
module.js:327
throw err;
^

Error: Cannot find module '../build/Release/hcaptha.node'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (E:\MyProject\bishe\boke\jackblog-api-koa\node_modules.npminstall\ccap\0.6.4\ccap\lib\hcap.js:4:13)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (E:\MyProject\bishe\boke\jackblog-api-koa\node_modules.npminstall\ccap\0.6.4\ccap\index.js:1:80)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
[00:06:46] [nodemon] app crashed - waiting for file changes before starting...

npm start error yield next;

gulp serve

[09:26:36] Using gulpfile E:\zan\www\koa\jackblog-api-koa\gulpfile.js
[09:26:36] Starting 'nodemon'...
[09:26:36] Finished 'nodemon' after 2.96 ms
[09:26:36] Starting 'serve'...
[09:26:36] Finished 'serve' after 8.02 μs
[09:26:36] [nodemon] 1.8.1
[09:26:36] [nodemon] to restart at any time, enter rs
[09:26:36] [nodemon] watching: E:\zan\www\koa\jackblog-api-koa\server/*/
[09:26:36] [nodemon] starting node server\app.js
E:\zan\www\koa\jackblog-api-koa\server\config\seed.js:112
yield next;
^^^^^

SyntaxError: Unexpected strict mode reserved word
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:414:25)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object. (E:\zan\www\koa\jackblog-api-koa\server\app.js:23:1
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:134:18)
at node.js:961:3
[09:26:37] [nodemon] app crashed - waiting for file changes before starting..

mac npm install 安装不了 报错

WARN tar ENOENT: no such file or directory, open '/Users/rachelhao/Desktop/jackblog-api-koa-master/node_modules/.staging/nyc-102709d8/node_modules/core-js/library/fn/symbol/has-instance.js'
WARN tar ENOENT: no such file or directory, open '/Users/rachelhao/Desktop/jackblog-api-koa-master/node_modules/.staging/nyc-102709d8/node_modules/core-js/library/fn/symbol/to-string-tag.js'
WARN tar ENOENT: no such file or directory, open '/Users/rachelhao/Desktop/jackblog-api-koa-master/node_modules/.staging/nyc-102709d8/node_modules/core-js/library/fn/symbol/for.js'
WARN tar ENOENT: no such file or directory, open '/Users/rachelhao/Desktop/jackblog-api-koa-master/node_modules/.staging/nyc-102709d8/node_modules/core-js/library/fn/symbol/unscopables.js'
WARN tar ENOENT: no such file or directory, open '/Users/rachelhao/Desktop/jackblog-api-koa-master/node_modules/.staging/nyc-102709d8/node_modules/core-js/library/fn/symbol/observable.js'
npm ERR! Unexpected end of JSON input while parsing near '...transpiler":"^5.6.1",'

程序运行不起来呀

建议添加详细安装说明吧,小白不太懂,
请问win本地测试为什么还要安装Python 2.7,Microsoft Visual Studio C++ 2013呢?
我测试其他nodejs程序都不需要安装这么多呀?

一个关于您源码的问题有些看不懂,希望获得您的回答:)

在auth.service.js这个文件里的isAuthenticated方法中,有这样一段,这个user._id是在什么时候传入的,我不是很明白,望作者解答:
image

比如,我在user.test.js中看到的me方法的调用并没有传入id,但这里调用时会执行isAuthenticated方法时必须要判断传过来的参数中是否有_id,如果这里的me方法没有传的话那又是从哪里传过来的这个_id值呢?
c9z 0k4edlg44l6o0n64g

关于七牛云存储的配置问题

我自己申请了一个七牛云的账号,在运行您的上传图片的测试用例时发现上传成功了,但域名是七牛云分配的免费域名,是不是还要配置下镜像存储和绑定一下自己的域名,才能将存储后的路径图片路径通过这样:http://upload.jackhu.top/article/article/test.png 访问。
而且关于这点我还有点不明白的就是这样以来的话我是不是要在自己配置好的那个域名下保存一份,在七牛这边再保存一份呢

调试问题

项目怎么下断点调试的啊,为什么我使用node-inspector 启动app.js,不能启动。。直接 node app.js就可以。

在windows平台install会报错,错误出在安装koa-redis库的时候

当安装koa-redis时,会要求安装hiredis,此时会抛出以下错误

[email protected] install E:\Study\前端\blog\jackblog\jackblog-api-koa\node_modules\hiredis
node-gyp rebuild
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.

按要求安装Python后(装的是Python2.7版本),又会抛出C++相关的错误。

请问在windows下,是否有办法成功 install koa-redis ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.