RisingStack / graffiti-mongoose

⚠️ DEVELOPMENT DISCONTINUED - Mongoose (MongoDB) adapter for graffiti (Node.js GraphQL ORM)
https://risingstack-graffiti.signup.team/
MIT License
382 stars 52 forks source link

not require the use of babel-node in npm package #33

Closed nha closed 9 years ago

nha commented 9 years ago

I am already using babel-node programmatically in my project. But babel-node doesn't go through node_modules. If I instruct it to do so, then it fails on an express middleware ("static is a reserved keyword"). It would make it easier to not require the use of babel in the npm package.

tothandras commented 9 years ago

I am not sure if I understand it right, but graffiti-mongoose is transpiled to ES5, if you install it using npm, it shouldn't be a problem.

nha commented 9 years ago

You understood right. Is there a way for me to get rid of that error ?

/node_modules/@risingstack/graffiti/src/koa/index.js:14
    return function *(next) {
                    ^
SyntaxError: Unexpected token *
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Module._extensions..js (module.js:478:10)
nha commented 9 years ago

It looks like it should be possible using babel-node arguments, but I am fuzzy on the details and asked a question there : http://stackoverflow.com/questions/33174008/babel-node-not-ignore-some-node-modules

hekike commented 9 years ago

@nha hi it's a generator function. You don't need babel for that just use the latest Node.js: 4.x.x

nha commented 9 years ago

@hekike Ah thanks let me try that.

nha commented 9 years ago

Alright it seems to solve the issue (I have another one related to gyp-rebuild and probably osx but it seems unrelated so I will close this issue). Thanks @hekike.

hekike commented 9 years ago

@nha ok, sure! Probably you need to update some of your packages and I also recommend to remove node_modules folder and npm install it again because the updated node-gyp. More info here: https://nodejs.org/en/blog/weekly-updates/weekly-update.2015-09-04/