首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法让graphql-js测试套件开箱即用

无法让graphql-js测试套件开箱即用
EN

Stack Overflow用户
提问于 2019-12-02 06:52:47
回答 1查看 25关注 0票数 0

我派生并克隆了graphql-js存储库的新版本,并尝试使用贡献指南中列出的步骤运行测试套件,而没有对存储库进行任何更改。

代码语言:javascript
复制
npm install
npm test

每次我尝试这样做时,测试套件都无法运行,并出现以下两个错误。

代码语言:javascript
复制
/Users/dw/Developer/open-source/graphql-js/src/error/GraphQLError.js
  86:17  error  Parsing error: Identifier 'GraphQLError' has already been declared

  84 | }
  85 |
> 86 | export function GraphQLError( // eslint-disable-line no-redeclare
     |                 ^
  87 |   message: string,
  88 |   nodes?: $ReadOnlyArray<ASTNode> | ASTNode | void,
  89 |   source?: ?Source,

/Users/dw/Developer/open-source/graphql-js/src/type/definition.js
  352:17  error  Parsing error: Identifier 'GraphQLList' has already been declared

  350 | }
  351 | // eslint-disable-next-line no-redeclare
> 352 | export function GraphQLList(ofType) {
      |                 ^
  353 |   if (this instanceof GraphQLList) {
  354 |     this.ofType = assertType(ofType);
  355 |   } else {

✖ 2 problems (2 errors, 0 warnings)

希望有人能帮我解决这个问题,或者我以前见过它。谢谢!

EN

回答 1

Stack Overflow用户

发布于 2019-12-14 07:47:10

尝试使用yarn而不是npm进行安装。

当我使用npm install (使用Node12.13.1和npm 6.12.1)安装时,我看到了同样的错误,但是当我使用yarn install (使用yarn 1.12.1)安装时,它可以工作。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59130729

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档