我正在安装木偶师图书馆



我正在尝试构建一个简单的web scraper,我要做的第一件事就是安装puppeteer库。所以我运行以下命令(我使用的是最新的linux Mint(:sudo npm init -ysudo npm i puppeteer,但我得到了这些错误:

▌ ╢░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
WARN engine puppeteer@3.0.2: wanted: {"node":">=10.18.1"} (current: {"node":"8.10.0","npm":"3.5.2"})
loadDep:ws → request      ▄ ╢███████████████████████████░░░░░░░░░░░░░░░░╟
> puppeteer@3.0.2 install /home/USER/Documents/anna/file/node_modules/puppeteer
> node install.js
(node:11081) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "original" argument must be of type function
at promisify (internal/util.js:209:11)
at Object.<anonymous> (/home/USER/Documents/anna/file/node_modules/extract-zip/index.js:11:18)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/USER/Documents/anna/file/node_modules/puppeteer/lib/BrowserFetcher.js:25:17)
(node:11081) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:11081) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
file@1.0.0 /home/USER/Documents/anna/file
└── puppeteer@3.0.2  extraneous
npm WARN ws@7.2.5 requires a peer of bufferutil@^4.0.1 but none was installed.
npm WARN ws@7.2.5 requires a peer of utf-8-validate@^5.0.2 but none was installed.
npm WARN file@1.0.0 No description
npm WARN file@1.0.0 No repository field.

你知道为什么会这样吗?

看起来您需要升级Node.js版本。输出中的警告:

WARN engine puppeteer@3.0.2: wanted: {"node":">=10.18.1"} (current: {"node":"8.10.0","npm":"3.5.2"})

表示您正在运行节点8.10,Puppeter期望节点>=10.18.1。

最新更新