Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
getNative
✓ const getNative = require('lodash._getnative');
✗ import getNative from 'lodash._getnative';
This package is a CommonJS module only, originating from Lodash v3. It does not support ES module imports directly. Attempting to import it using `import` syntax will result in a runtime error in native ESM environments.
Demonstrates how to import and use the internal `getNative` function to retrieve a reference to a native method, like `Object.prototype.toString`.
const getNative = require('lodash._getnative');
// getNative is an internal Lodash helper designed to safely retrieve a reference to a native function
// or method, circumventing potential userland overrides that could exist on prototypes or global objects.
// This ensures that Lodash can always rely on the original, untampered native behavior.
const nativeToString = getNative(Object.prototype, 'toString');
if (typeof nativeToString === 'function') {
console.log('Successfully retrieved native Object.prototype.toString function.');
// Using the retrieved native function to get the type of an array
console.log('Type of [] is:', nativeToString.call([])); // Expected output: [object Array]
console.log('Type of null is:', nativeToString.call(null)); // Expected output: [object Null]
} else {
console.log('Failed to retrieve native toString function. This package might not be compatible with your environment or Lodash version.');
}
// Note: This package is an internal utility and not intended for general application development.
Debug
Known issues
breakingThis `lodash._getnative` package is specifically tied to Lodash v3's internal architecture. Users running Lodash v4 or newer should not use this standalone module, as its functionality has likely been refactored or removed in later Lodash versions, potentially leading to runtime errors or incorrect behavior.fixMigrate to the main Lodash v4+ package or `lodash-es` and rely on its internal mechanisms, rather than direct usage of old internal sub-modules.
affects: >=4.0.0 (of Lodash core library)
deprecatedThis specific package (`lodash._getnative@3.9.1`) is considered abandoned. It has not received updates since the Lodash v3 era and is not maintained for compatibility with modern Node.js or browser environments, nor with later major versions of Lodash.fixAvoid using this package in new projects. For existing projects, consider a full migration to the latest Lodash version or a modern alternative, which encapsulates this kind of internal helper.
affects: All versions of `lodash._getnative`
gotchaThis module exposes an internal Lodash helper function. It is not part of Lodash's public API and is not intended for direct use by application developers. Its behavior, existence, and API surface can change without adhering to semantic versioning guidelines for public-facing modules.fixRefrain from depending on internal Lodash modules. Instead, use official Lodash functions or re-evaluate your need for such a low-level utility, potentially implementing it yourself if truly necessary and understanding the risks.
affects: All versions of `lodash._getnative`
gotchaThis package is a CommonJS-only module. It does not natively support ECMAScript Module (ESM) `import` syntax. Attempting to use it directly in a native ESM environment will result in a `ReferenceError: require is not defined`.fixIf you must use this package in an ESM context, you will need to use a CommonJS interop wrapper or a build tool (like Webpack or Rollup) that handles CJS-to-ESM transpilation. The recommended fix, however, is to avoid this deprecated package entirely.
affects: All versions of `lodash._getnative`
Errors
Common errors & fixes
ReferenceError: require is not defined
Attempting to `import` this CommonJS-only module directly in a JavaScript file that is treated as an ES module (e.g., in a Node.js project with `"type": "module"` or in modern browser environments).
fixChange your import statement to `const getNative = require('lodash._getnative');` if your environment supports CommonJS, or use a build tool to transpile. Ideally, migrate away from this abandoned package. TypeError: getNative is not a function
This error can occur if `lodash._getnative` is incorrectly imported (e.g., as a default import when it's not) or if it's being used in a Lodash v4+ context where the internal `getNative` helper's structure has changed or it's no longer exposed in this manner.
fixEnsure the correct `require` syntax is used (`const getNative = require('lodash._getnative');`). If using Lodash v4 or newer, avoid this standalone package as its internal helper might not be compatible or exist in the same form; rely on the main Lodash package. Audit
Dependencies
No dependency data recorded yet.