SMALL

Study/Node.js 60

No such file or directory: 'dev' 앱충돌 날 땐?

"No such file or directory: 'dev'" 앱 충돌이 날 때 아래와 같은 문구를 package.json에 추가해준다. Solution Node.js v12 or later (...) "scripts": { "start": "node src", "start:dev": "nodemon --watch --experimental-modules src/ src/index.js" }, "type": "module" } --experimental-modules 를 추가해주면 에러가 해결됩니다! 짠! 출처 :https://kingso.netlify.app/posts/error-nodemon-appcrashed/

Study/Node.js 2021.11.21

[NodeJS] NodeJs + Express.js + MySQL CRUD 연동

진행을 하려면 MYSQL, VSCode 설치가 필요합니다. https://code.visualstudio.com/download Download Visual Studio Code - Mac, Linux, Windows Visual Studio Code is free and available on your favorite platform - Linux, macOS, and Windows. Download Visual Studio Code to experience a redefined code editor, optimized for building and debugging modern web and cloud applications. code.visualstudio.com https://dev.mysql.c..

Study/Node.js 2021.06.19

[노드 JS] 입력 받기

최근 다시 Node JS를 배우게 되었다. 다시 복습겸 포스팅 함.. 1. readline 모듈 사용 소스 코드1 (한 줄 입력) const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); rl.on('line', function(line) { console.log(line); rl.close(); }).on("close", function() { process.exit(); }); 기본적으로 매개변수 line에 할당되는 것이 입력값이며, 문자열로 할당됨. 그리고 console.log(line); 에 의해 입력 받은 값이 출력됨 소스 코드2 ..

Study/Node.js 2021.03.30

[노드JS] 로그 모듈 설치하기

오랜만에 노드JS를 공부하는데 관리자권한으로 Cmd를 열어 로그 모듈을 설치하려고 하니 " npm should be run outside of the node repl, in your normal shell. " 라는 에러가 뜬다. 도대체 어디서부터 잘못된 걸까? 그냥 방법이 잘못된 것같아 검색을 통해 해결했다. 이렇게 진행하는 것이 아니다. C/Program File에 설치된 nodejs 폴더에 설치를 하는것이다! 이렇게 진행한다. 정상적으로 설치된다.

Study/Node.js 2019.08.17