์ต์ ๋ฒ์ ์ Node.js์์ ์ต์ ๋ฒ์ ์ Nodemon์ ์ฌ์ฉํ๋ฉด ์์ ์ ์ฌ์ฉ ์ค๋จ ๊ฒฝ๊ณ ๊ฐ ๊ธฐ๋ก๋ฉ๋๋ค.
์ด๊ฒ์ npm start
๋ฅผ ์ง์ (Nodemon์ ํตํ์ง ์๊ณ ) ์คํํ ๋ ์ฌ์ฉ ์ค๋จ ๊ฒฝ๊ณ ๊ฐ ๊ธฐ๋ก๋์ง ์๊ธฐ ๋๋ฌธ์ ์์ ์คํฌ๋ฆฝํธ๊ฐ ์๋๋ผ Nodemon๊ณผ ๊ด๋ จ์ด ์์ต๋๋ค.
nodemon -v
: 1.18.5node -v
: 11.0.0{
"watch": "nodemon",
"start": "node --experimental-modules --no-warnings -r dotenv/config server"
}
npm run watch
md5-5c7f483fc44346d27a37182ef5f13bdb
[DEP0106] DeprecationWarning: crypto.createDecipher is deprecated.
์์์ ์ง์ ํ ๋๋ก Nodemon ๋ฐ Node.js ๋ฒ์ ์ ์ฌ์ฉํฉ๋๋ค.
ํด๋นํ๋ ๊ฒฝ์ฐ ๋ช
๋ น์ --dump
ํ๋๊ทธ๋ฅผ ์ถ๊ฐํ๊ณ ์ฌ๊ธฐ์ ์ถ๋ ฅ์ ํฌํจํ์ฌ ๋ฏผ๊ฐํ/๊ฐ์ธ ์ธ๋ถ์ ๋ณด ๋๋ ํ ํฐ์ ์ ๊ฑฐ ํ์ธ์.
--trace-deprecations
๋ฅผ ์์ ์คํฌ๋ฆฝํธ์ ์ถ๊ฐํ๋ ค๊ณ ์๋ํ์ง๋ง ์์ ์คํฌ๋ฆฝํธ ์ ์ ์คํ๋๋ Nodemon ์ฝ๋(๋๋ ์ข
์์ฑ)์ ์ํด ์ง์ ์ค๋จ ๊ฒฝ๊ณ ๊ฐ ํธ๋ฆฌ๊ฑฐ๋๊ธฐ ๋๋ฌธ์ ํจ๊ณผ๊ฐ ์์ต๋๋ค.
๋ฒ ์ด index.js๋ก nodemon์ ์๋ํ๋ฉด ์ฌ์ ํ ๊ฒฝ๊ณ ๊ฐ ํ์๋ฉ๋๊น?
์ฆ.
echo "" > index.js
nodemon index.js
๋ค:
์ฌ์ค ๋๋ ๋ฌธ์ ๊ฐ ์๊ฒผ๋ค.
node index.js
=> ๊ฒฝ๊ณ ์์
nodemon index.js
=> ๊ฒฝ๊ณ ๋ฅผ ๋ฐ์์ต๋๋ค
๊ฐ์ ๋ฌธ์ ,
nodemon
๋ฒ์ : 1.18.6
๋ค์์ ์ถ์ ์ ๋๋ค.
> nodemon index.js
(node:27294) [DEP0106] DeprecationWarning: crypto.createDecipher is deprecated.
at [redacted]/node_modules/flatmap-stream/index.min.js:1:1264
at Object.<anonymous> ([redacted]/node_modules/flatmap-stream/index.min.js:1:1423)
at Module._compile (internal/modules/cjs/loader.js:707:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10)
at Module.load (internal/modules/cjs/loader.js:605:32)
at tryModuleLoad (internal/modules/cjs/loader.js:544:12)
at Function.Module._load (internal/modules/cjs/loader.js:536:3)
at Module.require (internal/modules/cjs/loader.js:643:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> ([redacted]/node_modules/event-stream/index.js:11:15)
๊ทธ๋ฆฌ๊ณ ๊ทธ๊ฒ์ ์์ ํ ์์ผ๋ก ์จ๋ค... ๊ทธ๊ฒ์ ์ผ์ข
์ ์ฃผ์
๊ณต๊ฒฉ์ธ ๊ฒ์ผ๋ก ๋ฐํ์ก์ต๋๋ค.
https://github.com/dominictarr/event-stream/issues/116
๊ด๋ จ: https://github.com/remy/nodemon/issues/1451
nodemon์์ ๋ฆด๋ฆฌ์ค๋ฅผ ์ป์ผ๋ ค๊ณ ํ์ง๋ง ํ ์คํธ๊ฐ ํต๊ณผํ์ง ๋ชปํ์ต๋๋ค(ํตํฉ ํ ์คํธ ์ค ํ๋๊ฐ ๋ฐฑ๊ทธ๋ผ์ด๋ ์๋ฒ๋ฅผ ์คํ ์ค์ธ ์ํ๋ก ๋ก๋๋ค).
์ฆ, nodemon์ ์๋ก ์ค์นํ๋ฉด [email protected]
๋ฅผ ๊ฐ์ ธ์์ผ ํ๋ฉฐ, ์ด ๊ฒฝ๊ณ ๊ฐ ๋ฐ์ํ๋ ๊ฒฝ์ฐ ์ง๊ธ ์ ๋ฆฌํด์ผ ํฉ๋๋ค.
๋๊ตฐ๊ฐ ํ
์คํธ(๊ทธ๋ฆฌ๊ณ nodemon install dif์ ๋ํด npm ls pstree.remy
๋ก ํ์ธ)ํ ์ ์์ต๋๊น?
์ด ๋ฌธ์ ๋ pstree.remy
๋ฆด๋ฆฌ์ค์์ ํด๊ฒฐ๋์์ต๋๋ค. ๊ฐ์ผ๋ ํจํค์ง๊ฐ nodemon
์ข
์์ฑ ํธ๋ฆฌ์์ ์ ๊ฑฐ๋์์ต๋๋ค. ๊ฐ์ฌ ํด์!
nodemon์์ ๋ฆด๋ฆฌ์ค๋ฅผ ์ป์ผ๋ ค๊ณ ํ์ง๋ง ํ ์คํธ๊ฐ ํต๊ณผํ์ง ๋ชปํ์ต๋๋ค(ํตํฉ ํ ์คํธ ์ค ํ๋๊ฐ ๋ฐฑ๊ทธ๋ผ์ด๋ ์๋ฒ๋ฅผ ์คํ ์ค์ธ ์ํ๋ก ๋ก๋๋ค).
@remy ํ ์คํธ์ ์คํจํ๋ค๋ ์์์ ๋ฃ๊ฒ ๋์ด ๊ธฐ์ฉ๋๋ค. ํ์คํ ๋ฌธ์ ๊ฐ ์์ต๋๋ค. #1464๋ฅผ ์ฐธ์กฐํ์ญ์์ค.
์์ํ ํธ๊ธฐ์ฌ์ผ๋ก @FallingSnow : ์คํ ์ถ์ ์์ ์์ํ์ฌ ์ฃผ์ ๊ณต๊ฒฉ์ด๋ผ๋ ๊ฒ์ ์ด๋ป๊ฒ ์์์ต๋๊น? js์ min.js ํ์ผ ๋ถ์์ ์์ํ์ จ๋์?
๋ค์์ ์ถ์ ์ ๋๋ค.
```js
๋ ธ๋๋ชฌ index.js
(node:27294) [DEP0106] DeprecationWarning: crypto.createDecipher๋ ๋ ์ด์ ์ฌ์ฉ๋์ง ์์ต๋๋ค.
[ํธ์ง๋จ]/node_modules/flatmap-stream/index.min.js:1:1264์์
๊ฐ์ฒด์์.([ํธ์ง๋จ]/node_modules/flatmap-stream/index.min.js:1:1423)
...
@piotrturski ์คํ ์ถ์ ์ด ์๋ ๊ฒฝ์ฐ ์ข ์์ฑ์ด ์ค๋๋์๊ณ nodemon์ ์ ๊ทธ๋ ์ด๋๊ฐ ํ์ํฉ๋๋ค.
@piotrturski ๋ ๋๋ ํ๋ ํ์ด๋ก๋์ฒ๋ผ ๋ณด์ด๋ ์์ฃผ ์ด์ํ ์ฝ๋๋ฅผ ๋ง๋ ๋๊น์ง ์คํ ์ถ์ ์ ๋ฐ๋์ต๋๋ค.
์, js ํ์ผ์ ๋ถ์ํ์ต๋๋ค( https://github.com/dominictarr/event-stream/issues/116 ์ฐธ์กฐ).
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๊ทธ๋ฆฌ๊ณ ๊ทธ๊ฒ์ ์์ ํ ์์ผ๋ก ์จ๋ค... ๊ทธ๊ฒ์ ์ผ์ข ์ ์ฃผ์ ๊ณต๊ฒฉ์ธ ๊ฒ์ผ๋ก ๋ฐํ์ก์ต๋๋ค.
https://github.com/dominictarr/event-stream/issues/116
๊ด๋ จ: https://github.com/remy/nodemon/issues/1451