Skip to content

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

Closed
@phbrugnolo

Description

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'
}
}

Metadata

Assignees

No one assigned

    Labels

    staleno activity for 2 weeks

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions