# no-hide-core-modules

Rule `node/no-hide-core-modules`. Disallow third-party modules which are hiding core modules

- Source: node
- Technologies: Node.js
- Kind: correctness
- Needs type information: no
- Autofix: no
- Deprecated: yes
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #1978 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `n/no-hide-core-modules` | no | no | package `eslint-plugin-n` | [docs](https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-hide-core-modules.md) |

## Code examples

### Incorrect: the rule reports this

```js
const util = require("util")  // ERROR if `util` module exists in node_modules directory.
const path = require("path")  // ERROR if `path` module exists in node_modules directory.
// ...
```

### Correct: the rule accepts this

```js
const util = require("util")  // OK if this is the core module 'util' surely.
const path = require("path")  // OK if this is the core module 'path' surely.
```

Examples from the ESLint documentation.

## Enable it

### ESLint: `eslint.config.js`

```js
import n from "eslint-plugin-n";

export default [
  {
    plugins: { n },
    rules: {
      "n/no-hide-core-modules": "error",
    },
  },
];
```

## Related rules

- [node/no-restricted-import](https://lintradar.dev/rules/node/no-restricted-import.md): Disallow specified modules when loaded by `import` declarations
- [node/no-restricted-require](https://lintradar.dev/rules/node/no-restricted-require.md): Disallow specified modules when loaded by `require`
- [node/no-unsupported-features/es-builtins](https://lintradar.dev/rules/node/no-unsupported-features/es-builtins.md): Disallow unsupported ECMAScript built-ins on the specified version
- [node/no-unsupported-features/es-syntax](https://lintradar.dev/rules/node/no-unsupported-features/es-syntax.md): Disallow unsupported ECMAScript syntax on the specified version
- [node/no-unsupported-features/node-builtins](https://lintradar.dev/rules/node/no-unsupported-features/node-builtins.md): Disallow unsupported Node.js built-in APIs on the specified version
- [node/prefer-global/buffer](https://lintradar.dev/rules/node/prefer-global/buffer.md): Enforce either `Buffer` or `require("buffer").Buffer`

---

Web page: https://lintradar.dev/rules/node/no-hide-core-modules. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
