【问题标题】:I am having toruble installing the puppeteer library我在安装 puppeteer 库时遇到问题
【发布时间】:2020-08-14 20:58:40
【问题描述】:

我正在尝试构建一个简单的网络爬虫,我要做的第一件事就是安装 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 npm puppeteer


    【解决方案1】:

    您似乎需要升级您的 Node.js 版本。输出中的警告:

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

    表示您正在运行 Node 8.10,而 Puppeteer 需要 Node >= 10.18.1。

    【讨论】:

      猜你喜欢
      • 2023-03-12
      • 2021-12-13
      • 1970-01-01
      • 1970-01-01
      • 2021-11-11
      • 1970-01-01
      • 1970-01-01
      • 2020-05-31
      • 2019-12-06
      相关资源
      最近更新 更多