0

我正在尝试在我的流星项目中使用 apollp 堆栈。我用了

meteor add apollo
meteor npm install --save apollo-client apollo-server express 

安装阿波罗堆栈但是当我执行流星来运行我的项目时它给出了错误

/home/xxxxxx/Example/crud/.meteor/local/build/programs/server/packages/modules.js:97872
const graphql_1 = require('graphql');
^^^^^   
SyntaxError: Use of const in strict mode.
at/home/xxxxxx/Example/crud/.meteor/local/build/programs/server/boot.js:292:30
at Array.forEach (native)
at Function._.each._.forEach (/home/xxxxxxx/.meteor/packages/meteor-tool/.1.3.4_1.1wjluqr++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)

关于这里发生了什么的任何想法?

4

1 回答 1

2

我正在尝试做同样的事情。我想我可以让你进入下一步。只需在你的 npm install 中添加一些东西:

meteor npm install --save apollo-client apollo-server@^0.1.1 express graphql

我已经提交了一个 PR 以将 graphql 添加到文档中的 npm install 中。此外,apollo-server 最近更新到 0.2,但流星集成仍在处理它-@^0.1.1解决此问题后将不再需要。我仍然有一些问题,所以这可能无法让你一直到那里,但它为我解决了这个错误。

于 2016-08-08T22:34:02.427 回答