When trying to run eslint on my HP EliteBook 640 G11 (Intel Core Ultra 5 125U) I got this error:
C:\Users\test\Work\eslint-native-binding-test\eslint.config.mjs
1:1 error Resolve error: Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.
at Object.<anonymous> (C:\Users\test\Work\eslint-native-binding-test\node_modules\unrs-resolver\index.js:376:11)
at Module._compile (node:internal/modules/cjs/loader:1692:14)
at Object..js (node:internal/modules/cjs/loader:1824:10)
at Module.load (node:internal/modules/cjs/loader:1427:32)
at Module._load (node:internal/modules/cjs/loader:1250:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
at Module.require (node:internal/modules/cjs/loader:1449:12)
at require (node:internal/modules/helpers:135:16)
at Object.<anonymous> (C:\Users\test\Work\eslint-native-binding-test\node_modules\eslint-import-resolver-typescript\lib\index.cjs:30:31) import/no-unresolved
But on my Desktop PC (AMD CPU) it works well. I have spend a lot of time to solve it but no luck.
Please take a look at this (just for test) repo https://github.com/HakkaMc/eslint-native-binding-test and read the description and steps in the README. Probably the problem is with newer Intel architecture?
Thanks to everybody who is going to try it.
UPDATE:
The problem on my HP notebook was solved by installing several original HP hardware drivers for Windows! Using drivers installed by Windows Update system was not sufficient.
I experienced a similar issue related to Node.js version mismatch between my system and VSCode's ESLint extension.
My Setup:
Solution:
Adding the following setting to my VSCode `settings.json` resolved the issue:
{
"eslint.runtime": "node"
}
This ensures that the ESLint extension uses the same Node.js version from your system PATH (managed by asdf, nvm, etc.) instead of VSCode's built-in Node.js runtime.
Hope this helps someone facing similar issues!
I faced error
ERROR Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try npm i again after removing both package-lock.json and node_modules directory.
when creating new project on nuxt js. I've upgraded npm verison (npm update -g npm) to [email protected], then had to uprade node also from v18.18.2 to v22.9.0 (nvm install 22.9.0), as new version of npm supports only node versions ^20.17.0 || >=22.9.0. Then everything works. (btw I'm sitting on Apple M2 core).
So, maybe upgrading npm and nodejs versions could help you
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With