john-ahn 선생님의 boilerPlate 강의를 들으면서 mongoose 연결을 하는 부분에 겪었던 오류다.
나는 goorm ide로 하는지라 node.js 버전과 npm 버전이 고정되어있다.. 사지방이라 뭘 깔지도 못하고 ㅜㅜ
이 에러 같은 경우 세번째 줄에 나와있는 C: ~~ 이 주소를 따라 들어가서
"use strict";
const {TextDecoder, TextEncoder} = require("util")
const utf8Encoder = new TextEncoder();
const utf8Decoder = new TextDecoder("utf-8", { ignoreBOM: true });
function utf8Encode(string) {
return utf8Encoder.encode(string);
}
function utf8DecodeWithoutBOM(bytes) {
return utf8Decoder.decode(bytes);
}
module.exports = {
utf8Encode,
utf8DecodeWithoutBOM
};
이 부분을 추가해주면 된다.
나는 이 부분을 해결해줬는데도 에러가 하나 더 떴다..
최신 mongoose 버전을 다운받고 실행해보니까 무슨 flatMap is not function 이라는 에러가 뜬다.
알고보니까 내가 지금 쓰고있는 node버전에서는 flatMap 함수를 지원을 안해서 떴던 에러인 것 같다.
그래서 해결법은
강사님이 일일이 package.json 내용을 보여주는데 뭔가 내가 생각하기엔 이 버전을 그대로 다운받으라는 의미였던 것 같다..
강사님이 강의를 찍었을 당시 버전으로 다운을 받아주자
'boilerplate > Errors with goorm ide & gitpod' 카테고리의 다른 글
Cannot find module, node:internal/modules/cjs/loader:995:15 (0) | 2023.01.03 |
---|---|
create-react-app downgrade 18.0.1 to 16.8.6 (0) | 2023.01.03 |
(postMan 오류) not authorized on admin to excute command (0) | 2022.12.05 |
Goorm Ide로 컨테이너 만든 후 초기 add, commit, push 하기(2) (0) | 2022.12.02 |
Goorm Ide로 컨테이너 만든 후 초기 add, commit, push 하기(1) (0) | 2022.12.02 |