gpt4 book ai didi

node.js - Ubuntu 18.04 - npm 更新 - 错误 : canvas@2. 6.1 安装: `node-pre-gyp install --fallback-to-build`

转载 作者:行者123 更新时间:2023-12-04 18:31:27 24 4
gpt4 key购买 nike

尝试的 NodeJS 版本:

  • 13.13.0
  • 12.16.2
  • 8.10.0

  • npm 版本:6.14.4

    关注: https://askubuntu.com/questions/677498/unable-to-install-latest-nodejs-version-on-ubuntu-14-04
    并输入:
    curl -sL https://deb.nodesource.com/setup_0.13 | sudo bash -
    sudo apt-get install -y nodejs
    301 verbose stack Error: canvas@2.6.1 install: `node-pre-gyp install --fallback-to-build`
    301 verbose stack Exit status 1
    301 verbose stack at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
    301 verbose stack at EventEmitter.emit (events.js:315:20)
    301 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
    301 verbose stack at ChildProcess.emit (events.js:315:20)
    301 verbose stack at maybeClose (internal/child_process.js:1026:16)
    301 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
    302 verbose pkgid canvas@2.6.1
    303 verbose cwd /home/2PG
    304 verbose Linux 4.15.0-88-generic
    305 verbose argv "/usr/bin/node" "/usr/bin/npm" "update"
    306 verbose node v13.13.0
    307 verbose npm v6.14.4
    308 error code ELIFECYCLE
    309 error errno 1
    310 error canvas@2.6.1 install: `node-pre-gyp install --fallback-to-build`
    310 error Exit status 1
    311 error Failed at the canvas@2.6.1 install script.
    311 error This is probably not a problem with npm. There is likely additional logging output above.
    312 verbose exit [ 1, true ]

    完整日志: https://pastebin.com/V3N14w5p

    当我输入 sudo apt-get install npm :

    sudo apt-get install npm
    重现步骤:

    1) 创建新的 DigitalOcean NodeJS droplet (v8.10.0)

    2) 拖放 https://github.com/theADAMJR/2PG使用 FileZilla

    3) 进入文件夹并输入 npm i

    最佳答案

    这是一个已知的issue .不支持该版本的 Node。我建议你使用 12.x .

    如果你想使用 13.x .我能够在 13.1.0 上正确安装它,否则您需要等到他们更新软件包以支持您要使用的 Node 版本,这是所有 native 插件的常见问题。

    关于node.js - Ubuntu 18.04 - npm 更新 - 错误 : canvas@2. 6.1 安装: `node-pre-gyp install --fallback-to-build`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61340032/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com