λ©°μΉ μ μ λμΌν μμ μ΄ μ λλ‘ μλνκΈ° λλ¬Έμ μ΄κ²μ΄ 무μμ μ΄λ°νλμ§ νμ€νμ§ μμ΅λλ€. λλ μλ¬΄λ° ν¨κ³Όκ° μλλ‘ μ¬λΆν νμΌλ―λ‘ μλ§λ λ무 λ§μ νμΌ μ΄κΈ° λ¬Έμ κ° μλ κ²μ λλ€.
$ nodemon --debug --dump server.js
[nodemon] 1.8.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
--------------
node: v0.10.26
nodemon: 1.8.1
command: node /Users/rcoupe/.nvm/v0.10.26/bin/nodemon --debug --dump server.js
cwd: /Users/rcoupe/Code/overlay-management-system
OS: darwin x64
--------------
{ run: false,
system: { cwd: '/Users/rcoupe/Code/overlay-management-system' },
required: false,
dirs: [ '/Users/rcoupe/Code/overlay-management-system' ],
timeout: 1000,
options:
{ dump: true,
ignore:
[ '.git',
'node_modules',
'bower_components',
'.sass-cache',
re: /\.git|node_modules|bower_components|\.sass\-cache/ ],
watch: [ '*.*', re: /.*\..*/ ],
ignoreRoot: [ '.git', 'node_modules', 'bower_components', '.sass-cache' ],
restartable: 'rs',
colours: true,
execMap: { py: 'python', rb: 'ruby' },
stdin: true,
runOnChangeOnly: false,
verbose: false,
stdout: true,
execOptions:
{ script: 'server.js',
exec: 'node',
args: [ '--debug' ],
scriptPosition: 1,
nodeArgs: undefined,
ext: 'js,json',
env: {},
execArgs: [] },
monitor:
[ '*.*',
'!/Users/rcoupe/Code/overlay-management-system/.git/**/*',
'!/Users/rcoupe/Code/overlay-management-system/node_modules/**/*',
'!bower_components',
'!.sass-cache' ] },
load: [Function],
reset: [Function: reset],
lastStarted: 0,
loaded: [],
watchInterval: null,
command:
{ raw: { executable: 'node', args: [ '--debug', 'server.js' ] },
string: 'node --debug server.js' } }
--------------
+1
λλ μ΄μ λμΌν λ¬Έμ κ° μμκ³ NPM λ° Node.js λ²μ μ μ λ°μ΄νΈνμ¬ λ¬Έμ λ₯Ό ν΄κ²°νμ΅λλ€.
λλμ΄ λ¬Έμ κ° μ무λ°λμλ κ²μ²λΌ 보μ λλ€ ..... μ»΄ν¨ν°λ₯Ό λ€μ μμνμ§λ§ μ¬μ ν μλνμ§ μμ΅λλ€.
**μ΅μ npmμΌλ‘ μ κ·Έλ μ΄λνμ¬ λ¬Έμ λ₯Ό ν΄κ²°νμ΅λλ€.
NPMμ μ λ°μ΄νΈν΄λ λ¬Έμ κ° ν΄κ²°λμ§ μμμ΅λλ€. Nodemonμ λ€λ₯Έ νλ‘μ νΈμμ μ μλν©λλ€.
$ npm install -g npm
npm http GET https://registry.npmjs.org/npm
npm http 200 https://registry.npmjs.org/npm
npm http GET https://registry.npmjs.org/npm/-/npm-3.5.0.tgz
npm http 200 https://registry.npmjs.org/npm/-/npm-3.5.0.tgz
~/.nvm/v0.10.26/bin/npm -> ~/.nvm/v0.10.26/lib/node_modules/npm/bin/npm-cli.js
[email protected] ~/.nvm/v0.10.26/lib/node_modules/npm
$ nodemon server.js
[nodemon] 1.8.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node server.js`
[nodemon] Internal watch failed: watch EMFILE
$ npm -v
3.5.0
λλμ΄ λ¬Έμ κ° μμλ€. μ΄κ²μ΄ λ€λ₯Έ μ¬λμκ² λμμ΄ λ μ§ μ¬λΆλ μ μ μμ§λ§ /usr/local/bin λλ ν λ¦¬λ‘ μ΄λνμ¬ rm -rf
nodemonμ μ κ±°νμ΅λλ€. λλ μλνλ€ npm uninstall nodemon
νμ§λ§ λμκ² λ§νλ λ©μμ§λ₯Ό λ°ννλ€ npm WARN uninstall not installed in...
λλ₯Ό λ¨Όμ μ΄λ»κ² λ μλͺ» λλ λ΄κ° μ΄μ μ μλͺ»μ μ€μΉ κ²μΈμ§κ³Ό κ°λ±μ μΌμ’
μ΄ μμλ€ μ€μΉλ₯Ό μ¬λΆλ₯Ό κΆκΈνκ²νλ ?
κ°λ¨ν λ§ν΄μ μ΄μ nodemonμ μ κ±°νκ³ npm install -g nodemon
λ€μ μ€ννλλ° λͺ¨λ λ¬Έμ κ° ν΄κ²°λ κ² κ°μ΅λλ€.
λΉμ·ν λ¬Έμ κ° λ°μν©λλ€. λ Έλ 5.1.0 λ° NPM 3.3.12 μ¬μ©.
root<strong i="6">@014b87ca92f1</strong>:/var/www/html# nodemon app.js
[nodemon] 1.8.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
...
info: Server lifted in `/var/www/html`
info: To see your app, visit http://localhost:1337
info: To shut down Sails, press <CTRL> + C at any time.
debug: --------------------------------------------------------
debug: :: Mon Dec 07 2015 16:54:53 GMT+0000 (UTC)
debug: Environment : development
debug: Port : 1337
debug: --------------------------------------------------------
[nodemon] Internal watch failed: watch /var/www/html/node_modules/sails/node_modules/skipper/node_modules/multiparty/.travis.yml ENOSPC
νμ κ°μ νμΌμ μλλλ€. λ§€λ² λ¬΄μμλ‘ λ€λ₯Έ νμΌμ΄μ§λ§ μ½ 10μ΄ νμ νμ _[nodedemon] Internal watch failed_ λ©μμ§κ° νμλκ³ nodemonμ΄ μΆ©λν©λκΉ?
Docker 컨ν
μ΄λμμ μ΄κ²μ μ€ννκ³ μμ΅λλ€. Node, NPM, Nodemonμ λͺ¨λ μ μμ μΌλ‘ μ€μΉλ©λλ€.
NPMμ 3.5.1λ‘ μ
κ·Έλ μ΄λνλ €κ³ μλνμ§λ§ λ¬Έμ κ° ν΄κ²°λμ§ μμμ΅λλ€. ~10μ΄ νμλ μ¬μ ν μΆ©λμ΄ λ°μν©λκΉ?
--watch "./directory"λ₯Ό μ¬μ©ν΄ 보μμμ€. λλ₯Ό μν΄ κ·Έκ²μ ν¨κ³Όκ° μμλ€
μμ κ΄λ ¨ λ¬Έμ (re: ENOSPC)λ λ€μμ μν νμ¬ ν΄κ²°λμμ΅λλ€. μ λμ€ νμΌ μμ€ν κ³Ό ν λ²μ λ³Ό μ μλ νμΌ μμ λΆλͺ ν κ³ μ ν κ²μ΄ μμ΅λκΉ?
λλ νλ©΄μ ν΅ν΄ nodemonμ μ€ννκ³ μ΄κ²μ΄ λμκ² μΌμ΄λ¬μ λ νλ©΄ μΈμ μ μ’ λ£νκ³ μ μΈμ μ μμνμ¬ λ¬Έμ λ₯Ό ν΄κ²°νμ΅λλ€.
λ³κ²½λ max_user_watchs--------->echo fs.inotify.max_user_watches=582222 | sudo ν° -a /etc/sysctl.conf && sudo sysctl -p
μλ‘μ΄ Linuxμ© Windows νμ μμ€ν μμ μ΄ λ¬Έμ κ° μΌκ΄λκ² λνλ©λλ€.
μ΄κ²μ supervisor
, btwμμλ λ¬Έμ κ° λμ§ μλ κ² κ°μ΅λλ€.
@djensen47 μ€μ λ‘ Windows Ubuntu μ Έμ μ€λ₯(μ μ΄λ μ μκ²λ)λ EPERMμ΄λ©° μ¬κΈ°μμ μ€λͺ νλ EMFILEμ΄ μλλλ€.
Windows 10 Bashμμ λ°μνλ EPERM λ¬Έμ μ λν μμ μ¬νμ μ°Ύμ μ¬λμ΄ μμ΅λκΉ?
@Carpetfizz , λ°©κΈ Windows 10 Bashμ λμΌν λ¬Έμ κ° λ°μνμ΅λλ€. λ
Έλλͺ¬ 1.10.0, λ
Έλ 6.4.0.
νλμ νμΌλ§ λ³΄κ³ μμ΄λ μ€λ₯κ° λ°μν©λλ€(ex: nodemon -w app.js).
@Carpetfizz λλ₯Ό μν΄ νμ¬ κ²½λ‘μ λ΄κ° μ€νμ€μΈ μ€ν¬λ¦½νΈκ° ν¬ν¨λμ΄ μμ§ μμμ΅λλ€.
$ cd /
$ nodemon /tmp/myproject/bin/myproject.js
κΈ°λ³Έ μ€ν¬λ¦½νΈκ° ν¬ν¨λ ν΄λμ cdλ‘ μμ νμ΅λλ€.
μ°Έκ³ : μ λ μ°λΆν¬λ₯Ό μ¬μ©ν©λλ€.
killall -9 λ Έλκ° μ΄ λ¬Έμ λ₯Ό ν΄κ²°ν©λλ€.
λ΅λ³ κ°μ¬ν©λλ€! μ§κΈμ macOSλ₯Ό μ¬μ©νμ§λ§ W10Bashλ₯Ό λ€μ μ¬μ©ν΄μΌ νλ κ²½μ° μ루μ μ νμΈνκ² μ΅λλ€.
ps -ef | νλ‘μΈμ€ IDλ₯Ό μ°ΎκΈ° μν grep λ Έλ
κ·Έλ° λ€μ sudo kill -9
μ΄ λ¬Έμ λ μ΅κ·Ό νλμ΄ μμκΈ° λλ¬Έμ μ ν΄ μνλ‘ μλ νμλμμ΅λλ€. λ μ΄μ νλμ΄ λ°μνμ§ μμΌλ©΄ μλμΌλ‘ λ«νλλ€. μ΄κ²μ΄ μλͺ»λμλ€κ³ μκ°νκ±°λ λ¬Έμ κ° μ¬μ ν μ§μλλ κ²½μ° λκΈμ λ΅μ₯μ μ
λ ₯νλ©΄ @remy κ° (μλ!) νμ μ‘°μΉλ₯Ό
κΈ°μ¬ν΄μ£Όμ
μ κ°μ¬ν©λλ€ <3
μ΄ λͺ λ Ήμ μ€ν
echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
λλ μ€λ₯λ₯Ό μ»μλ€
sysctl: illegal option -- p
usage: sysctl [-bdehiNnoqx] name[=value] ...
sysctl [-bdehNnoqx] -a
λ΄κ° μμ νμ¬ λ΄ Macμμ κ·Έκ²μ ν΄κ²° node_modules
νκ³ λ€μ μ€μΉ nodemon
κ° globally_ μ¬μ© _not ν΅ν΄ λ€μ; κ·Έ ν μ μμ μΌλ‘ μλνμ΅λλ€.
μ¬μ§μ΄ κ°μ μ€λ₯κ° λ°μνμ΅λλ€.
[nodemon] λ΄λΆ κ°μ μ€ν¨: EMFILE: μ΄λ € μλ νμΌμ΄ λ무 λ§μ΅λλ€. κ°μ
nodemonμ μ κ±°νκ³ λ€μ μ€μΉνμ¬ λ¬Έμ λ₯Ό ν΄κ²°νμ΅λλ€.
npm uninstall -g nodemon;
npm install -g nodemon
μ΄κ²μ΄ λΉμ μκ²λ ν¨κ³Όκ° μκΈ°λ₯Ό λ°λλλ€ π
--ignore node_modules
μλν μ μμ΅λλ€.
κ°μ₯ μ μ©ν λκΈ
--watch "./directory"λ₯Ό μ¬μ©ν΄ 보μμμ€. λλ₯Ό μν΄ κ·Έκ²μ ν¨κ³Όκ° μμλ€