갑자기 실행 오류가 뜨네요..
❯ npm run dev
> nodebird@1.0.0 dev /Users/hangyujin/Desktop/JBBP/tutorial/nodebird/front
> next
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
error - ../../../../../node_modules/react-redux/es/components/Context.js:1:0
Module not found: Can't resolve 'react'
Import trace for requested module:
./../../../../../node_modules/react-redux/es/exports.js
./../../../../../node_modules/react-redux/es/index.js
./node_modules/next-redux-wrapper/es6/index.js
./store/configureStore.js
./pages/_app.js
https://nextjs.org/docs/messages/module-not-found
왜 그럴까요,,, nodemodules과 package-lock.json 삭제했다가 다시 npm install하고 실행해도 똑같습니다.
답변 1
1
npm ls react
npm ls next-redux-wrapper
하면 각각 결과가 어떻게 나오나요?
0
npm ls react
nodebird@1.0.0 /Users/hangyujin/Desktop/JBBP/tutorial/nodebird/front
├─┬ @ant-design/icons@4.7.0
│ ├─┬ rc-util@5.14.0
│ │ └── react@17.0.2 deduped
│ └── react@17.0.2 deduped
├─┬ antd@4.16.13
│ ├─┬ @ant-design/react-slick@0.28.4
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-cascader@1.4.3
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-checkbox@2.3.2
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-collapse@3.1.2
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-dialog@8.6.0
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-drawer@4.3.1
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-dropdown@3.2.0
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-field-form@1.20.1
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-image@5.2.5
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-input-number@7.1.4
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-mentions@1.6.1
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-menu@9.0.13
│ │ ├─┬ rc-overflow@1.2.2
│ │ │ └── react@17.0.2 deduped
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-motion@2.4.4
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-notification@4.5.7
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-pagination@3.1.9
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-picker@2.5.19
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-progress@3.1.4
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-rate@2.9.1
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-resize-observer@1.0.1
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-select@12.1.13
│ │ ├─┬ rc-virtual-list@3.4.1
│ │ │ └── react@17.0.2 deduped
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-slider@9.7.4
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-steps@4.1.4
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-switch@3.2.2
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-table@7.15.2
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-tabs@11.10.1
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-textarea@0.3.5
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-tooltip@5.1.1
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-tree-select@4.3.3
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-tree@4.2.2
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-trigger@5.2.10
│ │ ├─┬ rc-align@4.0.11
│ │ │ └── react@17.0.2 deduped
│ │ └── react@17.0.2 deduped
│ ├─┬ rc-upload@4.3.1
│ │ └── react@17.0.2 deduped
│ └── react@17.0.2 deduped
├─┬ next-redux-wrapper@7.0.5
│ └── react@17.0.2 deduped
├─┬ next@11.1.2
│ ├─┬ @next/react-dev-overlay@11.1.2
│ │ └── react@17.0.2 deduped
│ ├── react@17.0.2 deduped
│ ├─┬ styled-jsx@4.0.1
│ │ └── react@17.0.2 deduped
│ └─┬ use-subscription@1.5.1
│ └── react@17.0.2 deduped
├─┬ react-dom@17.0.2
│ └── react@17.0.2 deduped
├── react@17.0.2
└─┬ styled-components@5.3.1
└── react@17.0.2 deduped
❯ npm ls next-redux-wrapper
nodebird@1.0.0 /Users/hangyujin/Desktop/JBBP/tutorial/nodebird/front
└── next-redux-wrapper@7.0.5
이렇게 보여집니다!
0
모두 정상이라서 원인을 찾기 힘드네요. 소스코드 오타일 수도 있을 것 같긴 합니다만, 제 깃헙 소스코드 ch3 클론 받아서 진행해보세요.
https://github.com/ZeroCho/react-nodebird/tree/master/ch3/front
next-redux-wrapper가 6버전이라서 강좌 버전과 일치합니다.
0
감사합니다. 기존에 하던 프로젝트 폴더 아예 삭제하고 저 깃허브 폴더를 다운받아서 npm install만 하면 기존에 한 세팅(nextjs) 다시 전부 그대로 유지 되는건가요?
넥스트 버젼 질문
0
90
2
로그인시 401 Unauthorized 오류가 뜹니다
0
104
1
무한 스크롤 중 스크롤 튐 현상
0
191
1
특정 페이지 접근을 막고 싶을 때
0
116
2
createGlobalStyle의 위치와 영향범위
0
102
2
인라인 스타일 리렌더링 관련
0
97
2
vsc 에서 npm init 설치시 오류
0
157
2
nextjs 15버전 사용 가능할까요?
0
166
1
화면 새로고침 문의
0
129
1
RTK에서 draft, state 차이가 있나요?
0
160
2
Next 14 사용해도 될까요?
0
455
1
next, node 버전 / 폴더 구조 질문 드립니다.
0
358
1
url 오류 질문있습니다
0
214
1
ssh xxxxx로 우분투에 들어가려니까 port 22: Connection timed out
0
391
1
sudo certbot --nginx 에러
0
1293
2
Minified React error 콘솔에러 (hydrate)
0
477
1
카카오 공유했을 때 이전에 작성했던 글이 나오는 버그
0
255
1
프론트서버 배포 후 EADDRINUSE에러 발생
0
337
1
npm run build 에러
0
525
1
front 서버 npm run build 중에 발생한 에러들
0
398
1
서버 실행하고 브라우저로 들어갔을때 404에러
0
350
2
css 서버사이드 랜더링이 적용되지 않아서 문의 드립니다.
0
290
1
팔로워 3명씩 불러오고 데이터 합쳐주는걸로 바꾸고 서버요청을 무한으로하고있습니다.
0
249
2
해시태그 검색에서 throttle에 관해 질문있습니다.
0
206
1





