gpt4 book ai didi

graphql - 运行 apollo-server 时获取节点 "Error: Cannot find module ' core-js/proposals/array-flat-and-flat-map'"

转载 作者:行者123 更新时间:2023-12-04 14:21:20 26 4
gpt4 key购买 nike

apollo-server-Getting started

我正在使用上面的链接在我的系统中进行 apollo-server 设置。当我尝试使用 node index.js 运行节点文件时。我遇到以下错误:

internal/modules/cjs/loader.js:611
throw err;
^
Error: Cannot find module 'core-js/proposals/array-flat-and-flat-map'
at Function.Module._resolveFilename
(internal/modules/cjs/loader.js:609:15)
at Function.Module._load (internal/modules/cjs/`loader.js:535:25`)
at Module.require (internal/modules/cjs/`loader.js:663:17`)
at require (internal/modules/cjs/`helpers.js:20:18`)
at Object.<anonymous> (E:\`GraphQLApolloServer`\node_modules\`apollo-
env`\lib\`polyfills`\`array.js:3:1`)
at Module._compile (internal/modules/cjs/`loader.js:734:30`)
at Object.Module._extensions..`js` (internal/modules/cjs/`loader.js:745:10`)
at Module.load (internal/modules/cjs/`loader.js:626:32`)
at tryModuleLoad (internal/modules/cjs/`loader.js:566:12`)
at Function.Module._load (internal/modules/cjs/loader.js:558:3)`

知道如何解决这个错误吗?

我尝试了不同的方法,比如重新安装节点并升级到最新版本,但没有取得任何成功。

最佳答案

包.json

{
"name": "backend",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"apollo-server": "^2.3.3",
"core-js": "3.0.0-beta.11",
"graphql": "^14.1.1"
}
}

关于graphql - 运行 apollo-server 时获取节点 "Error: Cannot find module ' core-js/proposals/array-flat-and-flat-map'",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54491934/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com