Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

84쪽 예제 오류인가요? #4

Open
rnjsrnrdnjs opened this issue May 4, 2021 · 0 comments
Open

84쪽 예제 오류인가요? #4

rnjsrnrdnjs opened this issue May 4, 2021 · 0 comments

Comments

@rnjsrnrdnjs
Copy link

rnjsrnrdnjs commented May 4, 2021

fs.writeFile(fname,text); 부분에서 오류가 나길래 공식 문서를 찾아보니

fs.writeFile(file, data[, options], callback)
https://nodejs.org/dist/latest-v10.x/docs/api/fs.html#fs_fs_writefile_file_data_options_callback

함수의 인자로 3개를 받고 마지막에 콜백함수를 받는다고 합니다.

예제코드를 아래와 같이 바꾸니 해결됬습니다.
fs.writeFile(fname, text,(err)=>{
if (err) throw err;
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant