대충이라도 하자

internal/modules/cjs/loader.js:883 throw err; ^Error: Cannot find module './debug' 본문

꼬꼬마 개발자 노트/JS

internal/modules/cjs/loader.js:883 throw err; ^Error: Cannot find module './debug'

Sueeeeee
반응형

위의 에러를 발견하고 해결을 못하고 있었는데 한참 뒤에 깨달았다.

예를 들어 front와 back 두 가지를 한꺼번에 workspace에서 작업하고 있을 때,

각각의 디렉토리 안에 App.js, index.js와 같은 파일들이 공통적으로 존재하게 된다.

그런 경우에 이 에러가 발생하는 듯하다.

 

일단은, node_modules 폴더와 package.json-lock파일을 삭제한 뒤, 

npm install을 다시 해주면 에러가 사라진다.

반응형

'꼬꼬마 개발자 노트 > JS' 카테고리의 다른 글

node.js unsupported engine  (0) 2022.01.09
Basic React  (0) 2021.12.16
2021. 11. 29 (Closure in PHP, Closure in JS)  (0) 2021.11.29
Comments