errlens 1.0.10 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,199 @@
1
+ {
2
+ "Cannot read properties of undefined__explanation": "Você está tentando acessar uma propriedade de uma variável que está atualmente vazia.",
3
+ "Cannot read properties of undefined__why": "A variável não foi inicializada ou uma chamada de API ainda não foi concluída.",
4
+ "Cannot read properties of undefined__fix_0": "Use encadeamento opcional: user?.name",
5
+ "Cannot read properties of undefined__fix_1": "Defina um valor padrão: data || []",
6
+ "is not defined__explanation": "Você está usando uma variável que não foi declarada.",
7
+ "is not defined__why": "Erro de digitação no nome ou a variável está no escopo de outra função.",
8
+ "is not defined__fix_0": "Verifique erros de digitação",
9
+ "is not defined__fix_1": "Declare com const/let",
10
+ "is not a function__explanation": "Você chamou uma variável como função, mas ela é de outro tipo (String/Object).",
11
+ "is not a function__why": "A importação falhou ou um callback não foi passado corretamente.",
12
+ "is not a function__fix_0": "Verifique as importações",
13
+ "is not a function__fix_1": "Verifique o tipo com typeof",
14
+ "Cannot find module__explanation": "O Node.js não consegue encontrar o arquivo ou pacote que você está importando.",
15
+ "Cannot find module__why": "O pacote não está instalado ou o caminho relativo está incorreto.",
16
+ "Cannot find module__fix_0": "Execute 'npm install'",
17
+ "Cannot find module__fix_1": "Verifique a ortografia do caminho do arquivo",
18
+ "EADDRINUSE__explanation": "A porta que o seu servidor deseja usar já está sendo utilizada.",
19
+ "EADDRINUSE__why": "Outra instância da sua aplicação já está em execução.",
20
+ "EADDRINUSE__fix_0": "Encerre o outro processo",
21
+ "EADDRINUSE__fix_1": "Altere o número da porta",
22
+ "Maximum call stack size exceeded__explanation": "O limite da pilha de chamadas foi atingido devido a recursão excessiva ou uma cadeia de chamadas muito profunda.",
23
+ "Maximum call stack size exceeded__why": "Uma função recursiva está se chamando muitas vezes sem atingir um caso base, ou uma cadeia de chamadas de função se acumula de forma muito profunda.",
24
+ "Maximum call stack size exceeded__fix_0": "Verifique as condições de saída da recursão",
25
+ "Maximum call stack size exceeded__fix_1": "Verifique se os casos base recursivos são alcançáveis",
26
+ "Maximum call stack size exceeded__fix_2": "Verifique a profundidade da cadeia de chamadas e loops de construção de pilha",
27
+ "ECONNREFUSED__explanation": "Sua aplicação tentou se conectar a um banco de dados/API mas foi rejeitada.",
28
+ "ECONNREFUSED__why": "O servidor de destino está fora do ar ou a URL está incorreta.",
29
+ "ECONNREFUSED__fix_0": "Certifique-se de que o BD está em execução",
30
+ "ECONNREFUSED__fix_1": "Verifique a URL da API",
31
+ "Assignment to constant variable__explanation": "Você tentou alterar uma variável 'const'.",
32
+ "Assignment to constant variable__why": "Variáveis const não podem ser reatribuídas.",
33
+ "Assignment to constant variable__fix_0": "Use 'let' em vez de 'const'",
34
+ "ENOENT__explanation": "Você está tentando ler um arquivo que não existe.",
35
+ "ENOENT__why": "O arquivo foi movido ou a string do caminho está incorreta.",
36
+ "ENOENT__fix_0": "Verifique se o arquivo existe",
37
+ "ENOENT__fix_1": "Use path.join()",
38
+ "await is only valid in async functions__explanation": "Você usou 'await' dentro de uma função normal.",
39
+ "await is only valid in async functions__why": "Await requer a palavra-chave 'async' na função pai.",
40
+ "await is only valid in async functions__fix_0": "Adicione 'async' à definição da função",
41
+ "ERR_HTTP_HEADERS_SENT__explanation": "Você enviou uma resposta depois de já ter enviado uma.",
42
+ "ERR_HTTP_HEADERS_SENT__why": "Múltiplas chamadas res.send() em uma única rota.",
43
+ "ERR_HTTP_HEADERS_SENT__fix_0": "Use 'return res.send()' para interromper a execução",
44
+ "buffering timed out__explanation": "O Mongoose não conseguiu se conectar ao MongoDB a tempo.",
45
+ "buffering timed out__why": "O banco de dados está offline ou a string de conexão está incorreta.",
46
+ "buffering timed out__fix_0": "Verifique o status do MongoDB",
47
+ "buffering timed out__fix_1": "Verifique a string de conexão",
48
+ "jwt malformed__explanation": "O token fornecido não possui uma estrutura JWT válida.",
49
+ "jwt malformed__why": "O token está corrompido ou apenas parte dele foi enviada.",
50
+ "jwt malformed__fix_0": "Verifique o cabeçalho 'Authorization'",
51
+ "jwt malformed__fix_1": "Verifique a geração do token",
52
+ "secretOrPrivateKey must have a value__explanation": "A chave secreta JWT está ausente.",
53
+ "secretOrPrivateKey must have a value__why": "A variável de ambiente (JWT_SECRET) não está carregada.",
54
+ "secretOrPrivateKey must have a value__fix_0": "Verifique o arquivo .env",
55
+ "secretOrPrivateKey must have a value__fix_1": "Execute dotenv.config()",
56
+ "E11000__explanation": "Você está salvando dados com um campo 'unique' que já existe.",
57
+ "E11000__why": "Geralmente um Email ou Nome de Usuário duplicado no banco de dados.",
58
+ "E11000__fix_0": "Verifique se os dados existem antes de salvar",
59
+ "E11000__fix_1": "Use tratamento de erro para unicidade",
60
+ "Unexpected token < in JSON__explanation": "Você tentou analisar JSON, mas recebeu HTML.",
61
+ "Unexpected token < in JSON__why": "Sua API retornou uma página de erro (HTML) em vez de dados (JSON).",
62
+ "Unexpected token < in JSON__fix_0": "Verifique a URL da API",
63
+ "Unexpected token < in JSON__fix_1": "Verifique os logs do servidor para falhas",
64
+ "CORS__explanation": "O navegador bloqueou sua solicitação por motivos de segurança.",
65
+ "CORS__why": "O servidor não permite solicitações do domínio do seu frontend.",
66
+ "CORS__fix_0": "Instale o pacote 'cors' no servidor",
67
+ "CORS__fix_1": "app.use(cors())",
68
+ "'map' of undefined__explanation": "Você está tentando iterar por um array que não existe.",
69
+ "'map' of undefined__why": "A variável é null/undefined em vez de um Array.",
70
+ "'map' of undefined__fix_0": "Inicialize como array vazio: data || []",
71
+ "'map' of undefined__fix_1": "Verifique a resposta da API",
72
+ "module not found 'dotenv'__explanation": "O pacote 'dotenv' está ausente.",
73
+ "module not found 'dotenv'__why": "Você o usou no código, mas não o instalou.",
74
+ "module not found 'dotenv'__fix_0": "npm install dotenv",
75
+ "validation failed__explanation": "Os dados não correspondem ao seu esquema Mongoose.",
76
+ "validation failed__why": "Campos obrigatórios ausentes ou tipos de dados incorretos.",
77
+ "validation failed__fix_0": "Verifique os campos obrigatórios",
78
+ "validation failed__fix_1": "Valide os dados no frontend",
79
+ "not authorized__explanation": "Acesso negado devido a credenciais ausentes ou inválidas.",
80
+ "not authorized__why": "Token expirado ou chave de API incorreta.",
81
+ "not authorized__fix_0": "Faça login novamente",
82
+ "not authorized__fix_1": "Verifique os cabeçalhos",
83
+ "status code 404__explanation": "O endpoint da API que você está chamando não existe.",
84
+ "status code 404__why": "URL incorreta ou a rota do servidor não está definida.",
85
+ "status code 404__fix_0": "Verifique a ortografia da rota da API",
86
+ "status code 404__fix_1": "Verifique a URL base",
87
+ "status code 500__explanation": "O servidor falhou ao processar sua solicitação.",
88
+ "status code 500__why": "Um erro no código do servidor backend.",
89
+ "status code 500__fix_0": "Verifique os logs do console do servidor",
90
+ "status code 500__fix_1": "Adicione try/catch no servidor",
91
+ "is not iterable__explanation": "Você usou um loop for...of ou spread (...) em algo que não é um array.",
92
+ "is not iterable__why": "Você tentou iterar sobre um Object ou Null.",
93
+ "is not iterable__fix_0": "Certifique-se de que a variável é um Array",
94
+ "is not iterable__fix_1": "Use Object.keys()",
95
+ "require is not defined__explanation": "Você está usando 'require' em um Módulo ES.",
96
+ "require is not defined__why": "O Node.js está configurado com 'type': 'module' no package.json.",
97
+ "require is not defined__fix_0": "Use 'import' em vez disso",
98
+ "require is not defined__fix_1": "Remova 'type: module'",
99
+ "EACCES__explanation": "Você não tem permissão para acessar este arquivo/porta.",
100
+ "EACCES__why": "Você precisa de direitos de administrador ou o arquivo está bloqueado.",
101
+ "EACCES__fix_0": "Use 'sudo' (Linux/Mac)",
102
+ "EACCES__fix_1": "Verifique as permissões do arquivo",
103
+ "has already been declared__explanation": "Você declarou o mesmo nome de variável duas vezes.",
104
+ "has already been declared__why": "Usar 'let' ou 'const' num nome que já existe no mesmo escopo.",
105
+ "has already been declared__fix_0": "Renomeie uma das variáveis",
106
+ "has already been declared__fix_1": "Remova a segunda declaração",
107
+ "PayloadTooLargeError__explanation": "Os dados que você enviou são grandes demais para o servidor.",
108
+ "PayloadTooLargeError__why": "Geralmente uma imagem ou arquivo que excede o limite do body-parser.",
109
+ "PayloadTooLargeError__fix_0": "Aumente o limite: app.use(express.json({limit: '50mb'}))",
110
+ "set property of null__explanation": "Você está tentando atribuir um valor a uma propriedade de uma variável vazia.",
111
+ "set property of null__why": "O objeto que você está modificando ainda não foi criado.",
112
+ "set property of null__fix_0": "Inicialize o objeto primeiro",
113
+ "set property of null__fix_1": "Verifique se não é null",
114
+ "socket hang up__explanation": "O servidor fechou a conexão inesperadamente.",
115
+ "socket hang up__why": "O servidor travou ou ocorreu um timeout.",
116
+ "socket hang up__fix_0": "Verifique a saúde do servidor",
117
+ "socket hang up__fix_1": "Aumente o limite de timeout",
118
+ "Unexpected end of JSON input__explanation": "Os dados JSON estão incompletos ou vazios.",
119
+ "Unexpected end of JSON input__why": "O servidor enviou uma string vazia em vez de JSON.",
120
+ "Unexpected end of JSON input__fix_0": "Verifique o corpo da resposta da API",
121
+ "Unexpected end of JSON input__fix_1": "Trate respostas vazias",
122
+ "Script execution timed out__explanation": "Seu código demorou muito para executar.",
123
+ "Script execution timed out__why": "Computação pesada ou loop infinito.",
124
+ "Script execution timed out__fix_0": "Otimize a lógica",
125
+ "Script execution timed out__fix_1": "Use worker threads",
126
+ "'then' of undefined__explanation": "Você chamou .then() em algo que não é uma Promise.",
127
+ "'then' of undefined__why": "A função não retornou uma promise.",
128
+ "'then' of undefined__fix_0": "Tornar a função 'async'",
129
+ "'then' of undefined__fix_1": "Retornar uma Promise",
130
+ "Invalid connection string__explanation": "O formato da URL do banco de dados está incorreto.",
131
+ "Invalid connection string__why": "Faltam símbolos como '@' ou '/' no URI.",
132
+ "Invalid connection string__fix_0": "Verificar o formato do URI do BD",
133
+ "window is not defined__explanation": "Você está tentando usar código de navegador (window) no Node.js.",
134
+ "window is not defined__why": "Node.js não possui um objeto 'window' (isso é para navegadores).",
135
+ "window is not defined__fix_0": "Verificar se está executando no navegador",
136
+ "window is not defined__fix_1": "Usar 'global' em vez disso",
137
+ "Too many listeners__explanation": "Vazamento de memória detectado em EventEmitters.",
138
+ "Too many listeners__why": "Adicionando event listeners dentro de um loop ou função repetida.",
139
+ "Too many listeners__fix_0": "Usar .once() em vez de .on()",
140
+ "Too many listeners__fix_1": "Remover listeners antigos",
141
+ "spread non-iterable__explanation": "Você tentou usar `...obj` onde não é permitido.",
142
+ "spread non-iterable__why": "Tentando fazer spread de um objeto em um array.",
143
+ "spread non-iterable__fix_0": "Usar colchetes [] para arrays e {} para objetos",
144
+ "EPIPE__explanation": "Pipe quebrado: enviando dados para uma conexão fechada.",
145
+ "EPIPE__why": "O outro lado (cliente/processo) parou de escutar.",
146
+ "EPIPE__fix_0": "Tratar erros de stream",
147
+ "EPIPE__fix_1": "Verificar se o processo está ativo",
148
+ "Missing initializer__explanation": "Você declarou uma const sem atribuir um valor.",
149
+ "Missing initializer__why": "Const deve ser definida imediatamente quando criada.",
150
+ "Missing initializer__fix_0": "Atribuir um valor: const x = 1;",
151
+ "peerinvalid__explanation": "Os pacotes instalados têm versões conflitantes.",
152
+ "peerinvalid__why": "Uma biblioteca precisa da versão A, outra precisa da versão B.",
153
+ "peerinvalid__fix_0": "npm install --legacy-peer-deps",
154
+ "filter is not a function__explanation": "Você está tentando filtrar algo que não é um array.",
155
+ "filter is not a function__why": "A variável é um objeto ou Null.",
156
+ "filter is not a function__fix_0": "Garanta que data é um Array: Array.isArray(data)",
157
+ "ENOTFOUND__explanation": "Falha na busca DNS para a URL.",
158
+ "ENOTFOUND__why": "Erro de digitação na URL ou sem conexão com a internet.",
159
+ "ENOTFOUND__fix_0": "Verifique a grafia da URL",
160
+ "ENOTFOUND__fix_1": "Verifique o DNS/Internet",
161
+ "reserved word__explanation": "Você usou uma palavra reservada do JS (como 'class' ou 'await') como nome de variável.",
162
+ "reserved word__why": "Não é permitido usar nomes como 'class' ou 'function' para variáveis.",
163
+ "reserved word__fix_0": "Renomeie a variável",
164
+ "Cannot find name__explanation": "O TypeScript não consegue encontrar essa variável ou tipo.",
165
+ "Cannot find name__why": "Variável não declarada ou falta o pacote @types.",
166
+ "Cannot find name__fix_0": "Verifique os imports",
167
+ "Cannot find name__fix_1": "Instale os tipos: npm install @types/node",
168
+ "convert undefined or null to object__explanation": "Chamando métodos de Object em uma variável vazia.",
169
+ "convert undefined or null to object__why": "Usando Object.keys(data) quando data é null.",
170
+ "convert undefined or null to object__fix_0": "Verifique se data existe: data && Object.keys(data)",
171
+ "Access-Control-Allow-Origin__explanation": "Erro de CORS: o servidor não está compartilhando dados com seu domínio.",
172
+ "Access-Control-Allow-Origin__why": "Política de segurança no backend.",
173
+ "Access-Control-Allow-Origin__fix_0": "Habilite o CORS no servidor",
174
+ "Invalid or unexpected token__explanation": "Há um caractere no seu código que não deveria estar lá.",
175
+ "Invalid or unexpected token__why": "Copiar e colar símbolos ocultos ou usar aspas inteligentes (” em vez de \").",
176
+ "Invalid or unexpected token__fix_0": "Digite manualmente a linha novamente",
177
+ "Invalid or unexpected token__fix_1": "Verifique se há símbolos invisíveis",
178
+ "timeout of 2000ms exceeded__explanation": "O seu teste demorou muito tempo a terminar.",
179
+ "timeout of 2000ms exceeded__why": "O código assíncrono não chamou 'done()' ou não terminou a tempo.",
180
+ "timeout of 2000ms exceeded__fix_0": "Aumente o tempo limite do teste",
181
+ "timeout of 2000ms exceeded__fix_1": "Verifique se há chamadas API lentas",
182
+ "does not exist on type__explanation": "Erro TypeScript: Acesso a uma propriedade que não existe na Interface.",
183
+ "does not exist on type__why": "A estrutura do objeto não corresponde à definição de Tipo do TS.",
184
+ "does not exist on type__fix_0": "Atualize a Interface",
185
+ "does not exist on type__fix_1": "Use conversão de tipo: (obj as any).prop",
186
+ "npm ERR! 404__explanation": "O NPM não consegue encontrar o pacote que pretende instalar.",
187
+ "npm ERR! 404__why": "Erro de digitação no nome do pacote ou é um pacote privado.",
188
+ "npm ERR! 404__fix_0": "Verifique a ortografia do pacote",
189
+ "npm ERR! 404__fix_1": "npm login",
190
+ "Unexpected end of input__explanation": "O seu código terminou abruptamente, provavelmente devido a um parêntese de fecho em falta.",
191
+ "Unexpected end of input__why": "Abriu um ( [ ou { mas esqueceu-se de o fechar com ) ] ou }.",
192
+ "Unexpected end of input__fix_0": "Verifique se faltam parênteses de fecho )",
193
+ "Unexpected end of input__fix_1": "Verifique se faltam chavetas }",
194
+ "Unexpected end of input__fix_2": "Certifique-se de que todas as aspas ' ou \" estão fechadas",
195
+ "missing ) after argument list__explanation": "Esqueceu-se de fechar uma chamada de função com ')'.",
196
+ "missing ) after argument list__why": "Um parêntese foi aberto mas a linha terminou ou outro símbolo apareceu antes de ser fechado.",
197
+ "missing ) after argument list__fix_0": "Adicione um ')' no final da sua chamada de função",
198
+ "missing ) after argument list__fix_1": "Verifique se apagou acidentalmente um ')' enquanto digitava"
199
+ }
@@ -0,0 +1,199 @@
1
+ {
2
+ "Cannot read properties of undefined__explanation": "您正在尝试访问一个当前为空的变量的属性。",
3
+ "Cannot read properties of undefined__why": "该变量未被初始化,或者 API 调用尚未完成。",
4
+ "Cannot read properties of undefined__fix_0": "使用可选链:user?.name",
5
+ "Cannot read properties of undefined__fix_1": "设置默认值:data || []",
6
+ "is not defined__explanation": "您正在使用一个尚未声明的变量。",
7
+ "is not defined__why": "名称拼写错误,或该变量的作用域在另一个函数内部。",
8
+ "is not defined__fix_0": "检查拼写错误",
9
+ "is not defined__fix_1": "使用 const/let 声明变量",
10
+ "is not a function__explanation": "您将一个变量作为函数调用,但它是其他类型(字符串/对象)。",
11
+ "is not a function__why": "导入失败或回调函数未正确传递。",
12
+ "is not a function__fix_0": "检查导入语句",
13
+ "is not a function__fix_1": "使用 typeof 验证类型",
14
+ "Cannot find module__explanation": "Node.js 无法找到您正在导入的文件或包。",
15
+ "Cannot find module__why": "包未安装或相对路径错误。",
16
+ "Cannot find module__fix_0": "运行 'npm install'",
17
+ "Cannot find module__fix_1": "检查文件路径拼写",
18
+ "EADDRINUSE__explanation": "您的服务器想要使用的端口已被占用。",
19
+ "EADDRINUSE__why": "您的应用程序的另一个实例已在运行。",
20
+ "EADDRINUSE__fix_0": "终止其他进程",
21
+ "EADDRINUSE__fix_1": "更改端口号",
22
+ "Maximum call stack size exceeded__explanation": "由于过度递归或非常深的调用链,已达到调用栈限制。",
23
+ "Maximum call stack size exceeded__why": "递归函数在未达到基本情况的情况下多次调用自身,或函数调用链累积过深。",
24
+ "Maximum call stack size exceeded__fix_0": "检查递归退出条件",
25
+ "Maximum call stack size exceeded__fix_1": "验证递归基本情况是否可达",
26
+ "Maximum call stack size exceeded__fix_2": "检查调用链深度和栈累积循环",
27
+ "ECONNREFUSED__explanation": "您的应用尝试连接到数据库/API 但被拒绝。",
28
+ "ECONNREFUSED__why": "目标服务器已关闭或 URL 错误。",
29
+ "ECONNREFUSED__fix_0": "确保数据库正在运行",
30
+ "ECONNREFUSED__fix_1": "检查 API URL",
31
+ "Assignment to constant variable__explanation": "您尝试修改一个 'const' 变量。",
32
+ "Assignment to constant variable__why": "常量变量无法被重新赋值。",
33
+ "Assignment to constant variable__fix_0": "使用 'let' 而非 'const'",
34
+ "ENOENT__explanation": "您正在尝试读取一个不存在的文件。",
35
+ "ENOENT__why": "文件已移动或路径字符串不正确。",
36
+ "ENOENT__fix_0": "验证文件是否存在",
37
+ "ENOENT__fix_1": "使用 path.join()",
38
+ "await is only valid in async functions__explanation": "您在普通函数内使用了 'await'。",
39
+ "await is only valid in async functions__why": "Await 需要在父函数上使用 'async' 关键字。",
40
+ "await is only valid in async functions__fix_0": "在函数定义中添加 'async'",
41
+ "ERR_HTTP_HEADERS_SENT__explanation": "您在已发送响应后又发送了一次响应。",
42
+ "ERR_HTTP_HEADERS_SENT__why": "在一个路由中多次调用 res.send()。",
43
+ "ERR_HTTP_HEADERS_SENT__fix_0": "使用 'return res.send()' 停止执行",
44
+ "buffering timed out__explanation": "Mongoose 无法在规定时间内连接到 MongoDB。",
45
+ "buffering timed out__why": "数据库离线或连接字符串错误。",
46
+ "buffering timed out__fix_0": "检查 MongoDB 状态",
47
+ "buffering timed out__fix_1": "检查连接字符串",
48
+ "jwt malformed__explanation": "提供的令牌不是有效的 JWT 结构。",
49
+ "jwt malformed__why": "令牌已损坏或只发送了部分令牌。",
50
+ "jwt malformed__fix_0": "检查 'Authorization' 标头",
51
+ "jwt malformed__fix_1": "验证令牌生成过程",
52
+ "secretOrPrivateKey must have a value__explanation": "JWT 密钥缺失。",
53
+ "secretOrPrivateKey must have a value__why": "环境变量(JWT_SECRET)未加载。",
54
+ "secretOrPrivateKey must have a value__fix_0": "检查 .env 文件",
55
+ "secretOrPrivateKey must have a value__fix_1": "运行 dotenv.config()",
56
+ "E11000__explanation": "您保存的数据中某个\"唯一\"字段已存在。",
57
+ "E11000__why": "通常是数据库中存在重复的邮箱或用户名。",
58
+ "E11000__fix_0": "保存前检查数据是否已存在",
59
+ "E11000__fix_1": "使用唯一性错误处理",
60
+ "Unexpected token < in JSON__explanation": "您尝试解析 JSON,但获得的是 HTML。",
61
+ "Unexpected token < in JSON__why": "您的 API 返回了错误页面(HTML)而非数据(JSON)。",
62
+ "Unexpected token < in JSON__fix_0": "检查 API 地址",
63
+ "Unexpected token < in JSON__fix_1": "检查服务器日志是否有崩溃",
64
+ "CORS__explanation": "浏览器出于安全原因阻止了您的请求。",
65
+ "CORS__why": "服务器不允许来自您前端域名的请求。",
66
+ "CORS__fix_0": "在服务器上安装 'cors' 包",
67
+ "CORS__fix_1": "app.use(cors())",
68
+ "'map' of undefined__explanation": "您正在尝试遍历一个不存在的数组。",
69
+ "'map' of undefined__why": "该变量是 null/undefined 而非数组。",
70
+ "'map' of undefined__fix_0": "初始化为空数组:data || []",
71
+ "'map' of undefined__fix_1": "检查 API 响应",
72
+ "module not found 'dotenv'__explanation": "缺少 'dotenv' 包。",
73
+ "module not found 'dotenv'__why": "您在代码中使用了它但未安装。",
74
+ "module not found 'dotenv'__fix_0": "npm install dotenv",
75
+ "validation failed__explanation": "数据与您的 Mongoose 模式不匹配。",
76
+ "validation failed__why": "缺少必填字段或数据类型错误。",
77
+ "validation failed__fix_0": "检查必填字段",
78
+ "validation failed__fix_1": "在前端验证数据",
79
+ "not authorized__explanation": "由于凭据缺失或无效而拒绝访问。",
80
+ "not authorized__why": "令牌已过期或 API 密钥错误。",
81
+ "not authorized__fix_0": "重新登录",
82
+ "not authorized__fix_1": "检查请求头",
83
+ "status code 404__explanation": "您调用的 API 端点不存在。",
84
+ "status code 404__why": "URL 错误或服务器路由未定义。",
85
+ "status code 404__fix_0": "检查 API 路由拼写",
86
+ "status code 404__fix_1": "检查基础 URL",
87
+ "status code 500__explanation": "服务器在处理您的请求时崩溃了。",
88
+ "status code 500__why": "后端服务器代码存在错误。",
89
+ "status code 500__fix_0": "检查服务器控制台日志",
90
+ "status code 500__fix_1": "在服务器端添加 try/catch",
91
+ "is not iterable__explanation": "您在非数组对象上使用了 for...of 循环或展开运算符 (...)。",
92
+ "is not iterable__why": "您尝试对 Object 或 Null 进行迭代。",
93
+ "is not iterable__fix_0": "确保变量是数组",
94
+ "is not iterable__fix_1": "使用 Object.keys()",
95
+ "require is not defined__explanation": "您在 ES 模块中使用了 'require'。",
96
+ "require is not defined__why": "package.json 中设置了 'type': 'module'。",
97
+ "require is not defined__fix_0": "改用 'import'",
98
+ "require is not defined__fix_1": "移除 'type: module'",
99
+ "EACCES__explanation": "您没有访问此文件/端口的权限。",
100
+ "EACCES__why": "您需要管理员权限或文件被锁定。",
101
+ "EACCES__fix_0": "使用 'sudo'(Linux/Mac)",
102
+ "EACCES__fix_1": "检查文件权限",
103
+ "has already been declared__explanation": "您重复声明了同一个变量名。",
104
+ "has already been declared__why": "在同一作用域中对已存在的名称使用了 'let' 或 'const'。",
105
+ "has already been declared__fix_0": "重命名其中一个变量",
106
+ "has already been declared__fix_1": "删除第二次声明",
107
+ "PayloadTooLargeError__explanation": "您发送的数据对服务器来说太大了。",
108
+ "PayloadTooLargeError__why": "通常是图片或文件超出了 body-parser 的限制。",
109
+ "PayloadTooLargeError__fix_0": "增加限制:app.use(express.json({limit: '50mb'}))",
110
+ "set property of null__explanation": "您试图为空变量的属性赋值。",
111
+ "set property of null__why": "您要修改的对象尚未创建。",
112
+ "set property of null__fix_0": "先初始化对象",
113
+ "set property of null__fix_1": "检查是否为 null",
114
+ "socket hang up__explanation": "服务器意外关闭了连接。",
115
+ "socket hang up__why": "服务器崩溃或发生超时。",
116
+ "socket hang up__fix_0": "检查服务器健康状态",
117
+ "socket hang up__fix_1": "增加超时限制",
118
+ "Unexpected end of JSON input__explanation": "JSON 数据不完整或为空。",
119
+ "Unexpected end of JSON input__why": "服务器发送了空字符串而不是 JSON。",
120
+ "Unexpected end of JSON input__fix_0": "检查 API 响应体",
121
+ "Unexpected end of JSON input__fix_1": "处理空响应",
122
+ "Script execution timed out__explanation": "您的代码运行时间过长。",
123
+ "Script execution timed out__why": "大量计算或无限循环。",
124
+ "Script execution timed out__fix_0": "优化逻辑",
125
+ "Script execution timed out__fix_1": "使用工作线程",
126
+ "'then' of undefined__explanation": "您在不是 Promise 的对象上调用了 .then()。",
127
+ "'then' of undefined__why": "该函数没有返回 promise。",
128
+ "'then' of undefined__fix_0": "将函数声明为 'async'",
129
+ "'then' of undefined__fix_1": "返回一个 Promise",
130
+ "Invalid connection string__explanation": "数据库 URL 格式错误。",
131
+ "Invalid connection string__why": "URI 中缺少 '@' 或 '/' 等符号。",
132
+ "Invalid connection string__fix_0": "检查数据库 URI 格式",
133
+ "window is not defined__explanation": "您正在 Node.js 中尝试使用浏览器代码 (window)。",
134
+ "window is not defined__why": "Node.js 没有 'window' 对象(这是浏览器专用的)。",
135
+ "window is not defined__fix_0": "检查是否在浏览器中运行",
136
+ "window is not defined__fix_1": "改用 'global'",
137
+ "Too many listeners__explanation": "EventEmitters 中检测到内存泄漏。",
138
+ "Too many listeners__why": "在循环或重复调用的函数中添加事件监听器。",
139
+ "Too many listeners__fix_0": "使用 .once() 而不是 .on()",
140
+ "Too many listeners__fix_1": "移除旧的监听器",
141
+ "spread non-iterable__explanation": "您在不允许的地方尝试使用 `...obj`。",
142
+ "spread non-iterable__why": "尝试将对象展开到数组中。",
143
+ "spread non-iterable__fix_0": "数组使用方括号 [],对象使用花括号 {}",
144
+ "EPIPE__explanation": "管道中断:向已关闭的连接发送数据。",
145
+ "EPIPE__why": "另一端(客户端/进程)停止监听。",
146
+ "EPIPE__fix_0": "处理流错误",
147
+ "EPIPE__fix_1": "检查进程是否存活",
148
+ "Missing initializer__explanation": "您声明了一个 const 但没有赋值。",
149
+ "Missing initializer__why": "常量必须在创建时立即设置。",
150
+ "Missing initializer__fix_0": "赋值:const x = 1;",
151
+ "peerinvalid__explanation": "已安装的包存在版本冲突。",
152
+ "peerinvalid__why": "一个库需要版本A,另一个库需要版本B。",
153
+ "peerinvalid__fix_0": "npm install --legacy-peer-deps",
154
+ "filter is not a function__explanation": "你试图对不是数组的内容进行 filter 操作。",
155
+ "filter is not a function__why": "该变量是对象或为 Null。",
156
+ "filter is not a function__fix_0": "确保数据是数组:Array.isArray(data)",
157
+ "ENOTFOUND__explanation": "该 URL 的 DNS 查询失败。",
158
+ "ENOTFOUND__why": "URL 拼写错误或没有网络连接。",
159
+ "ENOTFOUND__fix_0": "检查 URL 拼写",
160
+ "ENOTFOUND__fix_1": "检查 DNS/网络连接",
161
+ "reserved word__explanation": "你使用了 JS 的保留字(如 'class' 或 'await')作为变量名。",
162
+ "reserved word__why": "变量不能命名为 'class' 或 'function'。",
163
+ "reserved word__fix_0": "重命名该变量",
164
+ "Cannot find name__explanation": "TypeScript 找不到该变量或类型。",
165
+ "Cannot find name__why": "变量未声明或缺少 @types 包。",
166
+ "Cannot find name__fix_0": "检查 import 导入",
167
+ "Cannot find name__fix_1": "安装类型:npm install @types/node",
168
+ "convert undefined or null to object__explanation": "在空变量上调用 Object 方法。",
169
+ "convert undefined or null to object__why": "当 data 为 null 时使用 Object.keys(data)。",
170
+ "convert undefined or null to object__fix_0": "检查数据是否存在:data && Object.keys(data)",
171
+ "Access-Control-Allow-Origin__explanation": "CORS 错误:服务器未向你的域名开放数据共享。",
172
+ "Access-Control-Allow-Origin__why": "后端的安全策略。",
173
+ "Access-Control-Allow-Origin__fix_0": "在服务器端启用 CORS",
174
+ "Invalid or unexpected token__explanation": "代码中包含不该出现的字符。",
175
+ "Invalid or unexpected token__why": "复制粘贴时带有隐藏符号或用到了智能引号(如 ” 替代 \")。",
176
+ "Invalid or unexpected token__fix_0": "手动重新输入这一行",
177
+ "Invalid or unexpected token__fix_1": "检查是否存在不可见字符",
178
+ "timeout of 2000ms exceeded__explanation": "您的测试运行时间过长。",
179
+ "timeout of 2000ms exceeded__why": "异步代码未调用 'done()' 或未在规定时间内完成。",
180
+ "timeout of 2000ms exceeded__fix_0": "增加测试超时时间",
181
+ "timeout of 2000ms exceeded__fix_1": "检查是否存在缓慢的 API 调用",
182
+ "does not exist on type__explanation": "TypeScript 错误:访问了接口中不存在的属性。",
183
+ "does not exist on type__why": "对象结构与 TypeScript 类型定义不匹配。",
184
+ "does not exist on type__fix_0": "更新接口定义",
185
+ "does not exist on type__fix_1": "使用类型断言:(obj as any).prop",
186
+ "npm ERR! 404__explanation": "NPM 找不到您想要安装的包。",
187
+ "npm ERR! 404__why": "包名拼写错误或这是一个私有包。",
188
+ "npm ERR! 404__fix_0": "检查包名拼写",
189
+ "npm ERR! 404__fix_1": "npm login",
190
+ "Unexpected end of input__explanation": "您的代码突然中断,可能是缺少闭合括号。",
191
+ "Unexpected end of input__why": "您打开了 ( [ 或 { 但忘记用 ) ] 或 } 闭合。",
192
+ "Unexpected end of input__fix_0": "检查是否缺少闭合圆括号 )",
193
+ "Unexpected end of input__fix_1": "检查是否缺少闭合花括号 }",
194
+ "Unexpected end of input__fix_2": "确保所有引号 ' 或 \" 都已闭合",
195
+ "missing ) after argument list__explanation": "您忘记用 ')' 闭合函数调用。",
196
+ "missing ) after argument list__why": "圆括号已打开,但在闭合之前该行已结束或出现了其他符号。",
197
+ "missing ) after argument list__fix_0": "在函数调用末尾添加 ')'",
198
+ "missing ) after argument list__fix_1": "检查是否在输入时意外删除了 ')'"
199
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "errlens",
3
- "version": "1.0.10",
3
+ "version": "1.1.1",
4
4
  "description": "Professional CLI tool that explains JavaScript and Node.js errors in plain English with actionable fixes directly in your terminal.",
5
5
  "main": "./bin/index.js",
6
6
  "bin": {
@@ -28,11 +28,12 @@
28
28
  "files": [
29
29
  "bin/",
30
30
  "lib/",
31
+ "locales/",
31
32
  "README.md",
32
33
  "LICENSE"
33
34
  ],
34
35
  "scripts": {
35
- "test": "node --test test/**/*.test.js"
36
+ "test": "node --test test/**/*.test-lang.js"
36
37
  },
37
38
  "repository": {
38
39
  "type": "git",
@@ -52,5 +53,8 @@
52
53
  "commander": "^14.0.3",
53
54
  "fuse.js": "^7.0.0",
54
55
  "ora": "^9.3.0"
56
+ },
57
+ "directories": {
58
+ "lib": "lib"
55
59
  }
56
60
  }