프로그래밍 언어/Node.js

    npm ERR! This is probably not a problem with npm. There is likely additional logging output above

    npm ERR! This is probably not a problem with npm. There is likely additional logging output above

    프로젝트를 사용할 때 npm install npm run build 를 실행한 파일에 다시 npm run build를 사용하려고 하니 다음과 같은 에러가 나왔다. 해결방법 프로젝트 폴더 안에 node_modules 폴더를 지우고 npm install을 하면 새로운 node_modules이 생성되면서 서버가 실행된다.

    [node] nodemon 설치하기

    npm install nodemon --save-dev 노드몬을 설치하고 아래 명령어로 서버를 실행시킬 수 있다. yarn dev npm run dev

    node cannot find module

    요즘에는 npm이 node_modules 디렉토리를 수정할 떄 자동으로 생성되는 pakage-lock.json 파일을 사용할 수 있는데 node_modules의 정확한 버전을 추적하기 때문에 pakage.json 대신에 사용한다. node module 을 지우고 다시 설치했다. rm -rf node_modules npm install @types/node --save-dev

    [nodejs] SyntaxError: Cannot use import statement outside a module

    [nodejs] SyntaxError: Cannot use import statement outside a module

    import 해서 사용하려고 하는데 다음과 같은 에러가 나왓다. import { parser } from 'posthtml-parser' import fs from 'fs' package.json 에 제일 마지막 부분에 type : module 을 추가해준다. "type": "module"

    window yarn 설치

    npm을 이용해 yarn을 설치해준다 npm install -g yarn yarn 버전확인하기 yarn -v

    [nodejs] error cannot find module 'config'

    [nodejs] error cannot find module 'config'

    src/app.ts 에서 import config 를 사용하려는데 모듈을 찾을 수 없다고 나왔다. config package 를 설치해준다 npm i config

    typescript 설치 및 환경설정

    타입스크립트 설치하기 npm install -g typescript 버전확인하기 tsc -v 패키지를 생성하기위해 아래 명령어를 사용한다. package.json 과 tsconfig.json이 생성된다. npm init -y tsc -- init express 설치한다. npm install express 데브 의존성, 노드몬 설치 npm i -D typescript ts-node nodemon @types/node @types/express 아래 사이트에서 @types 를 검색해서 사용하면 된다 https://www.typescriptlang.org/dt/search?search= Search for typed packages Find npm packages that have type declarati..

    [nodejs] nodemailer

    npm init -y npm install nodemailer 공식홈페이지 nodemailer.com/about/ Nodemailer :: Nodemailer Nodemailer Nodemailer is a module for Node.js applications to allow easy as cake email sending. The project got started back in 2010 when there was no sane option to send email messages, today it is the solution most Node.js users turn to by default. Nodem nodemailer.com

    node.js 프로젝트 만들기 환경설정 및 설치

    아래 명령어를 순서대로 사용하거나 필요한 부분의 명령어만 사용하면 된다. npm install npm init //package.json 생성해줌 npm install socket.io --save npm install express --save npm install ejs --save npm install --save express-session npm install --save express-mysql-session npm install mysql npm i sequelize mysql2 npm i -g sequelize-cli sequelize init npm install -g nodemon //서버 자동 재시작 npm i dotenv //비밀키는 .env 라는 파일에 모아두고, dotenv가 ...

    노드 사용시 초기 설정과 설치 파일 ( node init, install )

    서버에서 세션 접근 할 때 req.session 이용 > npm init __filename : ex) Users\vusual studio code\nodechat\filename.js __dirname : Users\vusual studio code\nodechat\ npm i npm모듈 설치 Fn npm install socket.io --save socket.io 실시간 통신을 위한 npm install express --save express 서버를 위한 모듈 npm install ejs --save ejs Express에서 dynamic website를 만들기 위해 template으로 사용되는 파일 npm install --save express-session express에서 세션 사용하기 n..