每当我尝试安装koa yarn add apollo-server-koa graphql
时,都会出现此错误:
Couldn't find package "@koa/cors@^2.2.1" required by "apollo-server-koa" on the "npm" registry.
我尝试使用npm
而不是yarn
,但遇到相同的错误。
这是我的package.json
文件:
"name": "onlineshopbe",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"bcrypt": "^5.0.0",
"body-parser": "^1.19.0",
"cors": "^2.8.5",
"dotenv": "^8.2.0",
"express": "^4.17.1",
"express-handlebars": "^5.1.0",
"file-url": "^3.0.0",
"graphql": "^15.3.0",
"graphql-relay": "^0.6.0",
"graphql-sequelize": "^9.4.0",
"jsonwebtoken": "^8.5.1",
"koa": "^2.13.0",
"multer": "^1.4.2",
"nodemon": "^2.0.4",
"pg": "^8.3.0",
"sequelize": "^6.3.4"
},
"devDependencies": {},
"scripts": {
"start": "node index.js",
"dev": "nodemon index.js"
},
"author": "",
"license": "ISC"
}
有什么建议吗?