アポロを習っています。コードを実行すると、ブラウザにこのエラーが表示され、ブラウザの問題かどうかわかりません。誰でもこのエラーメッセージを修正するのを手伝ってもらえますか
./node_modules/@apollo/client/node_modules/optimism/lib/bundle.esm.js
Error: ENOENT: no such file or directory, open 'C:\Users\bijit\OneDrive\Desktop\wrk\JavaScript\pokemon\node_modules\@apollo\client\node_modules\optimism\lib\bundle.esm.js'
私のApp.jsファイル
import React from "react";
import ApolloClient from "apollo-boost";
import { ApolloProvider } from "@apollo/react-hooks";
import PokemonsContainer from "./container/PokemonsContainer";
function App() {
const client = new ApolloClient({
uri: "https://graphql-pokemon2.vercel.app/",
});
return (
<ApolloProvider client={client}>
<main>
<PokemonsContainer />
</main>
</ApolloProvider>
);
}
export default App;
ここに私の PokemonsContainer.js ファイルがあります
import React from 'react'
function PokemonsContainer(){
return(
<p>i am pokemon</p>
)
}
export default PokemonsContainer
私はすでに apollo クライアントとその他の依存関係をインストールしています。なぜこのエラーが発生しているのかわかりません。ここに私の package.json があります。
{
"name": "pokemon",
"version": "0.1.0",
"private": true,
"dependencies": {
"@apollo/client": "^3.3.12",
"@apollo/react-hooks": "^4.0.0",
"@babel/core": "^7.13.10",
"@babel/preset-env": "^7.13.10",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"apollo-boost": "^0.4.9",
"apollo-cache-inmemory": "^1.6.6",
"apollo-client": "^2.6.10",
"apollo-link": "^1.2.14",
"apollo-link-error": "^1.1.13",
"apollo-link-http": "^1.5.17",
"graphql": "^15.5.0",
"graphql-tag": "^2.11.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-hook": "^0.0.1",
"react-scripts": "4.0.3",
"web-vitals": "^1.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}