class SystemError extends errors.Error
Node.js generates system errors when exceptions occur within its runtime environment. These usually occur when an application violates an operating system constraint. For example, a system error will occur if an application attempts to read a file that does not exist.
stringstringstringnumberObjectstringstringnumberstringstringIf present, error.address is a string describing the address to which a
network connection failed.
stringThe error.code property is a string representing the error code.
stringIf present, error.dest is the file path destination when reporting a file
system error.
numberThe error.errno property is a negative number which corresponds
to the error code defined in libuv Error handling.
On Windows the error number provided by the system will be normalized by libuv.
To get the string representation of the error code, use
util.getSystemErrorName(error.errno).
ObjectIf present, error.info is an object with details about the error condition.
stringerror.message is a system-provided human-readable description of the error.
stringIf present, error.path is a string containing a relevant invalid pathname.
numberIf present, error.port is the network connection port that is not available.
stringThe error.syscall property is a string describing the syscall that failed.
This is a list of system errors commonly-encountered when writing a Node.js
program. For a comprehensive list, see the errno(3) man page.
-
EACCES(Permission denied): An attempt was made to access a file in a way forbidden by its file access permissions. -
EADDRINUSE(Address already in use): An attempt to bind a server (net,http, orhttps) to a local address failed due to another server on the local system already occupying that address. -
ECONNREFUSED(Connection refused): No connection could be made because the target machine actively refused it. This usually results from trying to connect to a service that is inactive on the foreign host. -
ECONNRESET(Connection reset by peer): A connection was forcibly closed by a peer. This normally results from a loss of the connection on the remote socket due to a timeout or reboot. Commonly encountered via thehttpandnetmodules. -
EEXIST(File exists): An existing file was the target of an operation that required that the target not exist. -
EISDIR(Is a directory): An operation expected a file, but the given pathname was a directory. -
EMFILE(Too many open files in system): Maximum number of file descriptors allowable on the system has been reached, and requests for another descriptor cannot be fulfilled until at least one has been closed. This is encountered when opening many files at once in parallel, especially on systems (in particular, macOS) where there is a low file descriptor limit for processes. To remedy a low limit, runulimit -n 2048in the same shell that will run the Node.js process. -
ENOENT(No such file or directory): Commonly raised byfsoperations to indicate that a component of the specified pathname does not exist. No entity (file or directory) could be found by the given path. -
ENOTDIR(Not a directory): A component of the given pathname existed, but was not a directory as expected. Commonly raised byfs.readdir. -
ENOTEMPTY(Directory not empty): A directory with entries was the target of an operation that requires an empty directory, usuallyfs.unlink. -
ENOTFOUND(DNS lookup failed): Indicates a DNS failure of eitherEAI_NODATAorEAI_NONAME. This is not a standard POSIX error. -
EPERM(Operation not permitted): An attempt was made to perform an operation that requires elevated privileges. -
EPIPE(Broken pipe): A write on a pipe, socket, or FIFO for which there is no process to read the data. Commonly encountered at thenetandhttplayers, indicative that the remote side of the stream being written to has been closed. -
ETIMEDOUT(Operation timed out): A connect or send request failed because the connected party did not properly respond after a period of time. Usually encountered byhttpornet. Often a sign that asocket.end()was not properly called.