npm 在 Mac 上使用 M1 处理器安装 chromedriver

npm install chromedriver on Mac with M1 processor

尝试在带有 M1 处理器的 Mac 上使用 npm 安装 chromedriver 并得到“仅 Mac 支持 64 位。”:

npm install chromedriver
npm WARN ancient lockfile 
npm WARN ancient lockfile The package-lock.json file was created with an old version of npm,
npm WARN ancient lockfile so supplemental metadata must be fetched from the registry.
npm WARN ancient lockfile 
npm WARN ancient lockfile This is a one-time fix-up, please be patient...
npm WARN ancient lockfile 
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated json3@3.3.2: Please use the native JSON object instead of JSON 3
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm ERR! code 1
npm ERR! path /Users/aaa/xxx/typescript-selenium-example/node_modules/chromedriver
npm ERR! command failed
npm ERR! command sh -c node install.js
npm ERR! Only Mac 64 bits supported.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/aaa/.npm/_logs/2022-03-07T23_22_42_068Z-debug-0.log

有人找到解决方法吗?

我遇到了同样的问题。我在使用 chromedriver 版本 87.0.1 或更高版本.

后开始工作
npm install chromedriver@87.0.1