Search
Duplicate

Node ์‹œ์ž‘ํ•˜๊ธฐ

Node ์‹œ์ž‘ํ•˜๊ธฐ

โ€ข
CMD ์—์„œ node ์‹คํ–‰
โ€ข
VSCODE ํ„ฐ๋ฏธ๋„ ์—์„œ ์‹คํ–‰
โ€ข
Node.js ์ข…๋ฃŒ
โ€ข
์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ(js) ํŒŒ์ผ ์‹คํ–‰

CMD ์—์„œ node ์‹คํ–‰

node
Shell
๋ณต์‚ฌ
let welcome = 'Hello node!'
Shell
๋ณต์‚ฌ
console.log(welcome)
Shell
๋ณต์‚ฌ

VSCODE ํ„ฐ๋ฏธ๋„ ์—์„œ ์‹คํ–‰

node
Shell
๋ณต์‚ฌ
let welcome = 'Hello node!'
Shell
๋ณต์‚ฌ
console.log(welcome)
Shell
๋ณต์‚ฌ

Node.js ์ข…๋ฃŒํ•˜๊ธฐ

ctrl + C, ctrl + C
Shell
๋ณต์‚ฌ
ctrl + D
Shell
๋ณต์‚ฌ
.exit
Shell
๋ณต์‚ฌ

์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ(js) ํŒŒ์ผ ์‹คํ–‰

โ€ข
test.js
function welcome() { console.log('Hello Node.js~!'); } welcome() /* node ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ์‹คํ–‰ > node (ํŒŒ์ผ๊ฒฝ๋กœ) */
JavaScript
๋ณต์‚ฌ
node test
PowerShell
๋ณต์‚ฌ