0

prisma init对于节点高级样板,我在运行命令后收到此错误。为什么不能做一个简单的注册突变?我只能在回滚到以前的版本后才能工作?为什么会这样? https://imgur.com/a/nMqHG

warning "graphql-yoga > apollo-upload-server@4.0.0-alpha.3" has incorrect peer dependency "graphql@0.11 - 0.12".
warning "graphql-yoga > graphql-playground-middleware-lambda@1.4.2" has unmet peer dependency "aws-lambda@^0.1.2".
warning "graphql-yoga > graphql-subscriptions@0.5.6" has incorrect peer dependency "graphql@^0.10.5 || ^0.11.3 || ^0.12.0".
warning "graphql-yoga > graphql-tools@2.18.0" has incorrect peer dependency "graphql@^0.11.0 || ^0.12.0".
warning "graphql-yoga > subscriptions-transport-ws@0.9.5" has incorrect peer dependency "graphql@^0.10.0 || ^0.11.0 || ^0.12.0".
warning "graphql-yoga > apollo-server-express > apollo-server-core@1.3.2" has incorrect peer dependency "graphql@^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0".
warning "prisma-binding > apollo-link@1.0.7" has incorrect peer dependency "graphql@^0.11.3 || ^0.12.3".
warning "graphql-yoga > apollo-server-express > apollo-server-core > apollo-cache-control@0.0.9" has incorrect peer dependency "graphql@^0.10.0 || ^0.11.0 || ^0.12.0".
warning "graphql-yoga > apollo-server-express > apollo-server-core > apollo-tracing@0.1.3" has incorrect peer dependency "graphql@^0.10.0 || ^0.11.0 || ^0.12.0".
warning "graphql-yoga > apollo-server-express > apollo-server-core > graphql-extensions@0.0.7" has incorrect peer dependency "graphql@^0.10.0 || ^0.11.0 || ^0.12.0".
warning "prisma-binding > graphql-tools@2.20.2" has incorrect peer dependency "graphql@^0.11.0 || ^0.12.0".
warning "graphql-cli > graphql-config@2.0.0" has unmet peer dependency "graphql@^0.11.0 || ^0.12.0 || ^0.13.0".
warning "prisma > prisma-cli-core > graphql-cli > graphql-playground-middleware-express@1.5.2" has unmet peer dependency "express@^4.16.2".
[4/4] Building fresh packages...
Done in 4.45s.
[graphql create] Installing node dependencies for /home/hafiz/Documents/fcc-fullstack/votes/server/.install/package.json...
yarn install v1.3.2
warning package.json: No license field
warning ../package.json: No license field
warning install@0.0.0: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > graphql-boilerplate-install@0.1.8" has unmet peer dependency "prisma@1.0.4".

我的 package.json

{
  "name": "server",
  "scripts": {
    "start": "nodemon -e js,graphql -x node -r dotenv/config src/index.js",
    "debug": "nodemon -e js,graphql -x node --inspect -r dotenv/config src/index.js",
    "playground": "graphql playground",
    "dev": "npm-run-all --parallel start playground"
  },
  "dependencies": {
    "bcryptjs": "2.4.3",
    "graphql-yoga": "1.3.2",
    "jsonwebtoken": "8.1.1",
    "prisma-binding": "1.5.10"
  },
  "devDependencies": {
    "dotenv": "5.0.0",
    "graphql-cli": "2.14.1",
    "nodemon": "1.14.12",
    "npm-run-all": "4.1.2",
    "prisma": "1.2.2"
  }
}
4

1 回答 1

0

发生这种情况是因为您没有安装您正在使用的包(graphql-yoga、prisma-binding 等)定义的对等依赖项。安装对等依赖项应该会删除您看到的警告。您更新后的 package.json 如下所示:

{
  "name": "server",
  "scripts": {
    "start": "nodemon -e js,graphql -x node -r dotenv/config src/index.js",
    "debug": "nodemon -e js,graphql -x node --inspect -r dotenv/config src/index.js",
    "playground": "graphql playground",
    "dev": "npm-run-all --parallel start playground"
  },
  "dependencies": {
    "bcryptjs": "2.4.3",
    "graphql-yoga": "1.3.2",
    "graphql": "^0.12.0",
    "aws-lambda": "^0.1.2",
    "jsonwebtoken": "8.1.1",
    "prisma-binding": "1.5.10",
    "express": "^4.16.2"
  },
  "devDependencies": {
    "dotenv": "5.0.0",
    "graphql-cli": "2.14.1",
    "nodemon": "1.14.12",
    "npm-run-all": "4.1.2",
    "prisma": "1.2.2"
  }
}
于 2018-03-23T16:25:03.873 回答