Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

619
Visualizações
How to fix eslint error when using the node: protocol when importing Node.js builtin modules

Please, direct me what should I write in .eslintrc in my situation.

https://github.com/nodejs/node/issues/38343
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md

If I deny this rule I got error:

import path from "path"; // ESLint: Prefer `node:path` over `path`.(unicorn/prefer-node-protocol)

Else I got this error:

import path from "node:path"; // ESLint: Unable to resolve path to module 'node:path'.(import/no-unresolved)

I want to use both of rules. But I can't imagine what to write down for linter to understand that node:path is just about the same as path. Node environment is enabled for this file:

"env": {
  "node": true
}

node -v -> v14.16.1

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Currently you need node 16 to use the "node:" prefix.

Support will be backported to node 14 and 12 but (at the time of writing this) these backports haven't been released yet.

Node 14.18.0 should include the backport (looking at this commit).

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda