웹프로그래밍/node.js & Typescript (18) 썸네일형 리스트형 Discord.js) Error: aborted 최근 discord.js 를 사용해 봇을 구축하고 있는데, 음악봇 기능을 개발하면서 다음과 같은 오류가 발생해 해결방법을 찾아 포스팅한다. 우선 오류는 아래와 같이 발생했다. 6|wow | Error: aborted 6|wow | at connResetException (node:internal/errors:704:14) 6|wow | at TLSSocket.socketCloseListener (node:_http_client:441:19) 6|wow | at TLSSocket.emit (node:events:525:35) 6|wow | at node:net:757:14 6|wow | at TCP.done (node:_tls_wrap:583:7) 일단 결론부터 얘기하자면 discord 는 bitrate .. Ubuntu) node.js 업그레이드 안됨 해결 오늘은 서버에서 node.js 를 업그레이드를 하려고 했는데, 수행이 안됬던 것을 해결해 포스팅한다. 먼저 보통 업그레이드를 수행하려고 한다면 아래와 같이 수행한다고 한다. sudo npm cache clean -f sudo npm install -g n sudo n stable 여기서 latest 버전으로 설치하고 싶으면, sudo n latest 를 하면 된다. 그런데, 아무리 위와 같이 수행해도 node -v 를 하였을 때, 버전이 그대로여서 해결방법은 아래와 같이 수행했다. nvm install node node -v 를 다시 쳐보니 정상적으로 업그레이드가 완료 되었다. Error: No valid exports main found for node_modules\colorette 프로젝트 구성후 css import 시에 위와 같은 오류 발생시, 구글링을 해본 결과 nodejs 버전이 낮을 경우 발생을 한다. nodejs 를 업데이트 해준 후 서버를 재시작 해주면 정상 동작한다. windows 경우에는 nodejs 에서 installer 로 업데이트 해주면 된다. Update to : node version 14.6.* this should resolve it. https://nodejs.org/ko/download/package-manager/ 패키지 매니저로 Node.js 설치하기 | Node.js Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. nodejs.org 출처: https://larac.. Node.js / Express.js - How to override/intercept res.render function? Old question, but found myself asking the same thing. How to intercept res render? Using express 4.0x something now. You can use/write middleware. The concept was a bit daunting to me at first, but after some reading it made a little more sense. And just for some context for anyone else reading this, the motivation for overriding res.render was to provide global view variables. I want session to.. 안전한 any 타입 만들기 타입스크립트에서 가장 유용한 타입은 무엇일까요? 저는 any 라고 생각합니다. 항상 타입 검사를 만족시킨다는 특성이 타입스크립트에서도 자바스크립트 모듈을 손쉽게 사용할 수 있게 해주기 때문입니다. 이렇게 자바스크립트의 거대한 생태계를 그대로 활용할 수 있게 해준다는 점에서, any는 타입스크립트의 생산성을 높여주는 유용한 타입입니다. declare const untypedModule: any; 그럼 타입스크립트에서 가장 유용하지 않은 타입은 무엇일까요? 저는 이 또한 any라고 생각합니다. 항상 타입 검사를 만족시킨다는 특성이 타입 검사의 의의를 퇴색시키기 때문입니다. 어떤 비정상적인 연산이라도 any 타입이 붙어버리면 타입 검사를 통해 걸러낼 수 없기 때문에 any는 프로그램의 안전성을 낮추는 유용하지.. [node.js] require is not defined in typescript *.ts 로 작업을 시작할때..require 를 사용하면 아래와 같은 오류가 발생할 수 있다. require is not defined in typescript 그럴땐 아래와 같이 npm 패키지를 설치해주자. npm install @types/node [node.js] adding .css file to ejs Your problem is not actually specific to ejs. 2 things to note here style.css is an external css file. So you dont need style tags inside that file. It should only contain the css. In your express app, you have to mention the public directory from which you are serving the static files. Like css/js/image it can be done byapp.use(express.static(__dirname + '/public')); assuming you put the css fi.. [node.js] Unable to include relative path file using Jade Template 이전 1 2 3 다음