运行ESLint时出现「Cannot find native binding」错误的求助(Intel酷睿Ultra 5 125U设备独有)
运行ESLint时出现「Cannot find native binding」错误的求助(Intel酷睿Ultra 5 125U设备独有)
我在HP EliteBook 640 G11(搭载Intel Core Ultra 5 125U处理器)上运行ESLint时,碰到了这个棘手的错误:
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. 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
奇怪的是,在我的AMD处理器台式机上,ESLint运行完全正常。我已经花了好长时间尝试各种方法,但都没解决问题。
我准备了一个专门用于测试的仓库,里面的README写了详细的问题背景和复现步骤,方便大家排查。
更新:问题终于解决了!原来是Windows更新自动安装的驱动不足以支持,我安装了HP官方提供的原厂硬件驱动后,这个错误就彻底消失了。
内容来源于stack exchange
相关产品推荐
相关产品推荐

