node - deptno/deptno.github.io GitHub Wiki
node
javascript runtime a.k.a nodejs
options
--max-old-space-size --max-new-space-size --require [file.js] --enable-source-maps --es-module-specifier-resolution=[node] # node μ κ²½μ°μλ esmodule νμΌμ νμ₯μλ₯Ό λͺ μνμ§ μμλ import κ° κ°λ₯ node@19 λΆν°λ μ κ±°λ μμ
esmodule
- __filename -> import.meta.url
- __dirname -> path.dirname(import.meta.url)
error
ECONNRESET
Error: Client network socket disconnected before secure TLS connection was established
at connResetException (internal/errors.js:609:14)
at TLSSocket.onConnectEnd (_tls_wrap.js:1536:19)
at Object.onceWrapper (events.js:421:28)
at TLSSocket.emit (events.js:327:22)
at endReadableNT (_stream_readable.js:1221:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
code: 'ECONNRESET',
ERR_OSSL_EVP_UNSUPPORTED
Failed to construct transformer: Error: error:0308010C:digital envelope routines::unsupported
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
node18μμλ μ€νμλκ³ node 16μμ μ€νλ¨ μ΄λ€ κ² λλ¬ΈμΈμ§λ μ°Ύμλ³΄μ§ μμ
Internal Error: spawn Unknown system error -8
package.json μ scriptμμ μμ€ν¬λ¦½νΈλ₯Ό μ€ννλ κ²½μ°μ λ°μ
#!/usr/bin/env bash
μ κ°μ΄ μ΅μλ¨ λΌμΈμ μμ λͺ
μν΄μ£Όλ©΄ ν΄κ²°λλ€
Internal Error: spawn Unknown system error -8
at ChildProcess.spawn (node:internal/child_process:413:11)
at Object.spawn (node:child_process:757:9)
at YK (/Users/deptno/.cache/node/corepack/yarn/3.3.1/yarn.js:4:6994)
at uh.implementation (/Users/deptno/.cache/node/corepack/yarn/3.3.1/yarn.js:392:17802)
at uh.exec (/Users/deptno/.cache/node/corepack/yarn/3.3.1/yarn.js:395:1585)
at uh.run (/Users/deptno/.cache/node/corepack/yarn/3.3.1/yarn.js:395:1756)
at I7 (/Users/deptno/.cache/node/corepack/yarn/3.3.1/yarn.js:401:6331)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async WRe (/Users/deptno/.cache/node/corepack/yarn/3.3.1/yarn.js:403:16)
at async o (/Users/deptno/.cache/node/corepack/yarn/3.3.1/yarn.js:403:146)
λλ²κΉ
memory leak
cross-env NODEOPTIONS=--inspect ts-node .
inspect
μ΅μ
μΌλ‘ λ€νλ₯Ό μμ±ν΄μ λ©λͺ¨λ¦¬ μΆμ μ΄ κ°λ₯νλ€.
λλ°μ΄μ€ λλ²κΉ
ν¬λ‘¬μμ νμΈμ΄κ°λ₯
- chrome://inspect/#devices
μ μ ν μΈμ€νν°λ₯Ό μ΄λ©΄ λ©λͺ¨λ¦¬ νμ΄ μ‘΄μ¬νκ³ μ¬κΈ°μ μ€μκ°μΌλ‘ μ¦κ°μ κ°μ νμΈμ΄ κ°λ₯
μ±λ₯ν μ€νΈ
λΆν ν μ€νΈ
νΉμ νμ΄μ§λ₯Ό μ§μμ μΌλ‘ ν΄μ tps μΈ‘μ μ΄ κ°λ₯νλ€.
μ΄μ ν¨κ» ν¬λ‘¬μ λ©λͺ¨λ¦¬ νμ νμΈν΄μ λ μ½λ©μ κ±Έκ³ λΆνν
μ€νΈλ₯Ό ν ν gc κ° λκ³ λμλ λ©λͺ¨λ¦¬κ° μλλλ‘ λμμ€μ§ μλμ§ νμΈμ΄ νμνλ€.