ProgrammingLang/node.js 3

[npm] 에러 해결 모음

1.ERROR: npm is known not to run on Node.js v10.19.0 https://nodejs.org/en/ Node.js Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. nodejs.org 가서 최신 nodejs 받은 다음에 기존 설치된 nodejs를 최신으로 교체하면 끝!! 1. 상세 - ubunu20.04의 경우 /usr/bin/nodejs 에 nodejs 파일이 존재 - node-v16.15.0-linux-x64/bin 에 존재하는 node 파일을 /usr/bin/nodejs 로 복사한다.

[node.js] 3. npm init 및 node.js 사용자 모듈 만들기

NPM (Node Package Manager) node.js에서 사용되는 package를 관리합니다. NPM을 이용한 패치 관리 초기화 #npm init jinkwon$ npm init This utility will walk you through creating a package.json file. It only covers the most common items, and tries to guess sensible defaults. See `npm help init` for definitive documentation on these fields and exactly what they do. Use `npm install ` afterwards to install a package and save i..

[node.js] 2. 전역 변수 및 전역 객체

[node.js] 2. 전역 변수 및 전역 객체 1. Node.js의 전역 변수 1) 전역 변수 - 프로그램 전역에서 사용 할수 있는 변수를 말합니다. - 다음은 전역 변수의 종류를 알아 보겠습니다. (1) 프로그램 Debugging용 - __filename : 현재 실행 중인 코드의 파일 경로를 나타 냅니다. - __dirname : 현재 실중 중인 코드의 디렉토리 경로를 나타 냅니다. 2. Node.js의 객체 1) 전역 객체 - 참조 링크 : https://nodejs.org/api/globals.html - 프로그램 전역에서 사용 할수 있는 변수를 말합니다. - 다음은 주요 전역 변수의 종류를 알아 보겠습니다. (1) console - 콘솔 화면과 관련된 기능을 다루는 객체 (2) process ..