Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

607
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!