【问题标题】:Trying to install graphql package with node [duplicate]尝试使用节点安装 graphql 包 [重复]
【发布时间】:2020-11-16 01:04:17
【问题描述】:
npm ERR! code ENOSELF
npm ERR! Refusing to install package with name "graphql" under a package
npm ERR! also called "graphql". Did you name your project the same
npm ERR! as the dependency you're installing?
npm ERR! 
npm ERR! For more information, see:

【问题讨论】:

  • 你的问题是什么?

标签: node.js npm graphql node-modules


【解决方案1】:

package.json 上的 name 属性更改为 graphql 以外的任何内容

【讨论】:

    【解决方案2】:

    编辑 package.json

    {
          "name": "graphql-basic", # --> change name but don't graphql
          "version": "1.0.0",
          "description": "",
          "main": "index.js",
          "scripts": {
              "test": "echo \"Error: no test specified\" && exit 1"
          },
          "author": "",
          "license": "ISC",
          "dependencies": {
              "express": "^4.17.1",
              "express-graphql": "^0.12.0",
              "graphql": "^15.4.0"
          }
    }
    

    【讨论】:

      猜你喜欢
      • 2014-08-01
      • 2015-04-09
      • 2019-12-09
      • 1970-01-01
      • 2014-07-07
      • 2020-10-11
      • 2020-11-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多