【问题标题】: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"
}
}