Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
Ever12349
node-api-cn
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
node-api-cn
/
errors
/
common_system_errors.md
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
42 lines (26 loc) · 2.32 KB
master
Breadcrumbs
node-api-cn
/
errors
/
common_system_errors.md
Copy path
Top
File metadata and controls
Code
Blame
42 lines (26 loc) · 2.32 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
以下列表是不完整的,但列举了编写
Node
.
js
程序时会遇到的一些常见的系统错误。
详细的列表可从
[
ERRNO
文档
]
找到。
-
`EACCES`
(
拒绝访问
)
:
试图以被一个文件的访问权限禁止的方式访问一个文件。
-
`EADDRINUSE`
(
地址已被使用
)
:
试图绑定一个服务器(
[
`net`
]
、
[
`http`
]
或
[
`https`
]
)到本地地址,但因另一个本地系统的服务器已占用了该地址而导致失败。
-
`ECONNREFUSED`
(
连接被拒绝
)
:
无法连接,因为目标机器积极拒绝。
这通常是因为试图连接到外部主机上的废弃的服务。
-
`ECONNRESET`
(
连接被重置
)
:
一个连接被强行关闭。
这通常是因为连接到远程
socket
超时或重启。
常发生于
[
`http`
]
和
[
`net`
]
模块。
-
`EEXIST`
(
文件已存在
)
:
一个操作的目标文件已存在,而要求目标不存在。
-
`EISDIR`
(
是一个目录
)
:
一个操作要求一个文件,但给定的路径是一个目录。
-
`EMFILE`
(
系统打开了太多文件
)
:
已达到系统
[
文件描述符
]
允许的最大数量,且描述符的请求不能被满足直到至少关闭其中一个。
当一次并行打开多个文件时会发生这个错误,尤其是在进程的文件描述限制数量较低的操作系统(如
macOS)。
要解决这个限制,可在运行
Node
.
js
进程的同一
shell
中运行
`ulimit -n 2048`
。
-
`ENOENT`
(
无此文件或目录
)
:
通常是由
[
`fs`
]
操作引起的,表明指定的路径不存在,即给定的路径找不到文件或目录。
-
`ENOTDIR`
(
不是一个目录
)
:
给定的路径虽然存在,但不是一个目录。
通常是由
[
`fs.readdir`
]
引起的。
-
`ENOTEMPTY`
(
目录非空
)
:
一个操作的目标是一个非空的目录,而要求的是一个空目录。
通常是由
[
`fs.unlink`
]
引起的。
-
`EPERM`
(
操作不被允许
)
:
试图执行一个需要更高权限的操作。
-
`EPIPE`
(
管道损坏
)
:
写入一个管道、socket
或
FIFO
时没有进程读取数据。
常见于
[
`net`
]
和
[
`http`
]
层,表明远端要写入的流已被关闭。
-
`ETIMEDOUT`
(
操作超时
)
:
一个连接或发送的请求失败,因为连接方在一段时间后没有做出合适的响应。
常见于
[
`http`
]
或
[
`net`
]
。
往往标志着
`socket.end()`
没有被正确地调用。
<
a
id
=
"nodejs-error-codes"
>
<
/
a
>
You can’t perform that action at this time.