Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nodemon not works with > /dev/null 2>&1 & #2237

Open
phbrugnolo opened this issue Nov 19, 2024 · 2 comments
Open

nodemon not works with > /dev/null 2>&1 & #2237

phbrugnolo opened this issue Nov 19, 2024 · 2 comments

Comments

@phbrugnolo
Copy link

I trying to run this command in WSL2 with Ubuntu 22.04

nohup nodemon --watch ./app/assets/stylesheets/ --ext scss,css --exec yarn build:css > /dev/null 2>&1 &

And seems is not working

Running the same command generating a log i got this error

nohup nodemon --watch ./app/assets/stylesheets/ --ext scss,css --exec yarn build:css > ~/nodemon.log 2>&1 &

nohup: ignoring input
�[33m[nodemon] 3.1.7�[39m
�[33m[nodemon] to restart at any time, enter rs�[39m
�[33m[nodemon] watching path(s): app/assets/stylesheets/**/*�[39m
�[33m[nodemon] watching extensions: scss,css�[39m
�[32m[nodemon] starting yarn build:css�[39m
node:events:496
throw er; // Unhandled 'error' event
^

Error: EBADF: bad file descriptor, read
Emitted 'error' event on ReadStream instance at:
at emitErrorNT (node:internal/streams/destroy:170:8)
at errorOrDestroy (node:internal/streams/destroy:239:7)
at node:internal/fs/streams:272:9
at FSReqCallback.wrapper [as oncomplete] (node:fs:671:5) {
errno: -9,
code: 'EBADF',
syscall: 'read'
}

Running with --verbose flag the error is the same

And nodemon --dump return


node: v22.11.0
nodemon: 3.1.7
command: /home/social/.nvm/versions/node/v22.11.0/bin/node /home/social/.nvm/versions/node/v22.11.0/bin/nodemon --dump
cwd: /home/social/social
OS: linux x64

{
run: false,
system: { cwd: '/home/social/social' },
required: false,
dirs: [ '/home/social/social' ],
timeout: 1000,
options: {
dump: true,
ignore: [
'/.git/',
'/.nyc_output/',
'/.sass-cache/',
'/bower_components/',
'/coverage/',
'/node_modules/',
re: /../.git/..|../.nyc_output/..|../.sass-cache/..|../bower_components/..|../coverage/..|../node_modules/../
],
watch: [ '.', re: /.../ ],
monitor: [
'.',
'!/.git/',
'!/.nyc_output/',
'!/.sass-cache/',
'!/bower_components/',
'!/coverage/',
'!/node_modules/'
],
ignoreRoot: [
'/.git/',
'/.nyc_output/',
'/.sass-cache/',
'/bower_components/',
'/coverage/',
'/node_modules/'
],
restartable: 'rs',
colours: true,
execMap: { py: 'python', rb: 'ruby', ts: 'ts-node' },
stdin: true,
runOnChangeOnly: false,
verbose: false,
signal: 'SIGUSR2',
stdout: true,
watchOptions: {},
execOptions: {
script: undefined,
exec: 'bin/rails server',
args: [],
scriptPosition: 0,
nodeArgs: undefined,
execArgs: [],
ext: 'js,mjs,cjs,json',
env: {}
}
},
load: [Function (anonymous)],
reset: [Function: reset],
lastStarted: 0,
loaded: [],
watchInterval: null,
signal: 'SIGUSR2',
command: {
raw: { executable: 'bin/rails server', args: [] },
string: 'bin/rails server'
}
}

@phbrugnolo phbrugnolo changed the title nodemon works with > /dev/null 2>&1 & nodemon not works with > /dev/null 2>&1 & Nov 19, 2024
@remy
Copy link
Owner

remy commented Nov 19, 2024

What do you get for the following command:

nohup yarn build:css > /dev/null 2>&1 &

@phbrugnolo
Copy link
Author

The code works correctly, and run build as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants